GNU bug report logs - #72448
"xdg-mime query filetype" fails silently on many filetypes (with fixes I see)

Previous Next

Package: guix;

Reported by: Sébastien Lerique <sl <at> eauchat.org>

Date: Sat, 3 Aug 2024 18:35:02 UTC

Severity: normal

To reply to this bug, email your comments to 72448 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#72448; Package guix. (Sat, 03 Aug 2024 18:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sébastien Lerique <sl <at> eauchat.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 03 Aug 2024 18:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sébastien Lerique <sl <at> eauchat.org>
To: bug-guix <at> gnu.org
Subject: "xdg-mime query filetype" fails silently on many filetypes (with
 fixes I see)
Date: Sat, 03 Aug 2024 20:33:47 +0200
Ahoy Guix!

"xdg-mime query filetype a-book.epub" or "whatever.pdf" returns nothing,
which is both puzzling and limiting as it blocks "xdg-open" to work for
many files.

My case was opening pdf or epub files from Emacs, which "xdg-open"
always sends to the browser, whatever my config (instead of e.g. evince
or Foliate).

So debugging shows that:
in ".xdg-mime-real",
(/gnu/store/06ll0ydqsf4bjxwpwsi68dmn2cg0biy6-xdg-utils-1.1.3/bin/xdg-mime
points there),
l.673-684 in "info_gnome()",
even if the "if ... elif ... elif ... fi" fails
(i.e. none of "gio", "gvfs-info", or "gnomevfs-info" are available),
then l.696 "if [ $? -eq 0 ]" gives always true.

Why? I don't know. I guess having a "case ..." instead of "if ... fi"
would solve this.

But the result is "exit_success" gets called whatever the situation, and
xdg-mime often gives no output, which then bugs "xdg-open".

Running this in "guix shell gnome-vfs" solves it, but what should be
done to fix? And how did this not appear earlier? (is xdg* new?)

The options I see are adding the "gnome-vfs" dependency ("gvfs" doesn't
provide "gvfs-info", and "gio" is not a package), or proposing "case"
instead of "if" upstream.

-- 
Sébastien Lerique
https://slvh.fr/




Information forwarded to bug-guix <at> gnu.org:
bug#72448; Package guix. (Sun, 04 Aug 2024 09:25:01 GMT) Full text and rfc822 format available.

Message #8 received at 72448 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Sébastien Lerique <sl <at> eauchat.org>, 
 72448 <at> debbugs.gnu.org
Subject: Re: "xdg-mime query filetype" fails silently on many filetypes
 (with fixes I see)
Date: Sun, 04 Aug 2024 11:23:03 +0200
Am Samstag, dem 03.08.2024 um 20:33 +0200 schrieb Sébastien Lerique:
> Ahoy Guix!
> 
> "xdg-mime query filetype a-book.epub" or "whatever.pdf" returns
> nothing, which is both puzzling and limiting as it blocks "xdg-open"
> to work for many files.
> 
> My case was opening pdf or epub files from Emacs, which "xdg-open"
> always sends to the browser, whatever my config (instead of e.g.
> evince or Foliate).
> 
> So debugging shows that:
> in ".xdg-mime-real",
> (/gnu/store/06ll0ydqsf4bjxwpwsi68dmn2cg0biy6-xdg-utils-1.1.3/bin/xdg-
> mime
> points there),
> l.673-684 in "info_gnome()",
> even if the "if ... elif ... elif ... fi" fails
> (i.e. none of "gio", "gvfs-info", or "gnomevfs-info" are available),
> then l.696 "if [ $? -eq 0 ]" gives always true.
> 
> Why? I don't know. I guess having a "case ..." instead of "if ... fi"
> would solve this.
Could you prepare a patch to do so?  Or has one already been proposed
upstream?

> But the result is "exit_success" gets called whatever the situation,
> and xdg-mime often gives no output, which then bugs "xdg-open".
> 
> Running this in "guix shell gnome-vfs" solves it, but what should be
> done to fix? And how did this not appear earlier? (is xdg* new?)
> 
> The options I see are adding the "gnome-vfs" dependency ("gvfs"
> doesn't provide "gvfs-info", and "gio" is not a package), or
> proposing "case" instead of "if" upstream.
Note: In GNOME, prefer `gio open', it's part of glib:bin.  
On other desktops, I don't know what the preferred solution would be.

Cheers




Information forwarded to bug-guix <at> gnu.org:
bug#72448; Package guix. (Fri, 09 Aug 2024 09:28:02 GMT) Full text and rfc822 format available.

Message #11 received at 72448 <at> debbugs.gnu.org (full text, mbox):

From: Sébastien Lerique <sl <at> eauchat.org>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 72448 <at> debbugs.gnu.org
Subject: Re: "xdg-mime query filetype" fails silently on many filetypes
 (with fixes I see)
Date: Fri, 09 Aug 2024 11:26:56 +0200

On 04 Aug 2024 at 11:23, Liliana Marie Prikler <liliana.prikler <at> gmail.com> wrote:

>> Why? I don't know. I guess having a "case ..." instead of "if ... fi"
>> would solve this.
> Could you prepare a patch to do so?  Or has one already been proposed
> upstream?
>

I can have a look and submit next month I'd say, being a little
underwater currently :)

>> The options I see are adding the "gnome-vfs" dependency ("gvfs"
>> doesn't provide "gvfs-info", and "gio" is not a package), or
>> proposing "case" instead of "if" upstream.
> Note: In GNOME, prefer `gio open', it's part of glib:bin.  
> On other desktops, I don't know what the preferred solution would be.
>

So "gio open" works indeed from the shell, but doomemacs only works
using "gnome-vfs", for a reason I can't figure out yet.

Best




This bug report was last modified 315 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.