Bug#1000588: evince,mailcap: "evince --new-window $file" opens the file chooser dialog instead of the requested file

2021-11-29 Thread Julien Cristau
On Fri, Nov 26, 2021 at 06:28:56AM +0900, Charles Plessy wrote:
> Le Thu, Nov 25, 2021 at 03:15:27PM +, Simon McVittie a écrit :
> > Control: reassign -1 mailcap 3.70
> > 
> > On Thu, 25 Nov 2021 at 15:13:01 +0100, Julien Cristau wrote:
> > 
> > Yes, update-mime should only be parsing the fields from the
> > [Desktop Entry] group, something like this (untested):
> 
> Thanks Julien and Simon,
> 
> I agree that the problem and the solution are in mailcap.
> 
> I am about to go for a business trip, so the fix may take a couple of
> weeks.  If you consider an NMU please go straight for a team upload
> and push the change in Salsa; as DDs you should have commit rights.
> 
> https://salsa.debian.org/debian/mailcap
> 
Thank you both.  I've tested locally, Simon's suggested patch fixes
evince, libreoffice and evolution entries for me, so I'll go ahead and
upload it.

Cheers,
Julien



Bug#1000588: evince,mailcap: "evince --new-window $file" opens the file chooser dialog instead of the requested file

2021-11-25 Thread Charles Plessy
Le Thu, Nov 25, 2021 at 03:15:27PM +, Simon McVittie a écrit :
> Control: reassign -1 mailcap 3.70
> 
> On Thu, 25 Nov 2021 at 15:13:01 +0100, Julien Cristau wrote:
> 
> Yes, update-mime should only be parsing the fields from the
> [Desktop Entry] group, something like this (untested):

Thanks Julien and Simon,

I agree that the problem and the solution are in mailcap.

I am about to go for a business trip, so the fix may take a couple of
weeks.  If you consider an NMU please go straight for a team upload
and push the change in Salsa; as DDs you should have commit rights.

https://salsa.debian.org/debian/mailcap

Have a nice day,

-- 
Charles Plessy Nagahama, Yomitan, Okinawa, Japan
Debian Med packaging team http://www.debian.org/devel/debian-med
Tooting from work,   https://mastodon.technology/@charles_plessy
Tooting from home, https://framapiaf.org/@charles_plessy



Bug#1000588: evince,mailcap: "evince --new-window $file" opens the file chooser dialog instead of the requested file

2021-11-25 Thread Simon McVittie
Control: reassign -1 mailcap 3.70

On Thu, 25 Nov 2021 at 15:13:01 +0100, Julien Cristau wrote:
> since upgrading from bullseye to bookworm, opening a pdf from mutt
> doesn't work.  The /etc/mailcap entry says:
> 
> > application/pdf; evince --new-window %s; test=test -n "$DISPLAY"
> 
> and indeed "evince --new-window foo.pdf" doesn't actually open foo.pdf.
> 
> Maybe this is intended though, and the problem is how update-mime parses
> evince's desktop file?  Looks like it's using the Exec line from
> [Desktop Action new-window] (which didn't exist in bullseye) instead of
> from the main [Desktop Entry] section.

Yes, update-mime should only be parsing the fields from the
[Desktop Entry] group, something like this (untested):

my $in_desktop_group = 0;
while () {
chomp;
next if m/^\s*$|^\s*\#/);
if (m/^\[Desktop Entry\]$/) {
$in_desktop_group = 1;
next;
}
if (m/^\[.*\]$/) {
$in_desktop_group = 0;
next;
}
next unless $in_desktop_group;
if (m/^Terminal=(\w+)/i) {
... the rest of the current implementation ...
}

The [Desktop Action x] groups are not relevant when using an application
as a handler for opening files listed in MimeType.

See the specification[1] for full syntax.

smcv

[1] 
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html



Bug#1000588: evince,mailcap: "evince --new-window $file" opens the file chooser dialog instead of the requested file

2021-11-25 Thread Julien Cristau
Package: evince, mailcap
Version: evince/41.2-1, mailcap/3.70

Hi,

since upgrading from bullseye to bookworm, opening a pdf from mutt
doesn't work.  The /etc/mailcap entry says:

> application/pdf; evince --new-window %s; test=test -n "$DISPLAY"

and indeed "evince --new-window foo.pdf" doesn't actually open foo.pdf.

Maybe this is intended though, and the problem is how update-mime parses
evince's desktop file?  Looks like it's using the Exec line from
[Desktop Action new-window] (which didn't exist in bullseye) instead of
from the main [Desktop Entry] section.

Cheers,
Julien

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (101, 
'unstable-debug'), (101, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.14.0-4-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages evince depends on:
ii  dconf-gsettings-backend [gsettings-backend]  0.40.0-2
ii  evince-common41.2-1
ii  gsettings-desktop-schemas41.0-2
ii  libatk1.0-0  2.36.0-2
ii  libc62.32-4
ii  libcairo-gobject21.16.0-5
ii  libcairo21.16.0-5
ii  libevdocument3-4 41.2-1
ii  libevview3-3 41.2-1
ii  libgdk-pixbuf-2.0-0  2.42.6+dfsg-2
ii  libglib2.0-0 2.70.1-1
ii  libgnome-desktop-3-1941.1-1
ii  libgtk-3-0   3.24.30-3
ii  libhandy-1-0 1.4.0-1
ii  libnautilus-extension1a  41.1-1
ii  libpango-1.0-0   1.48.10+ds1-1
ii  libpangocairo-1.0-0  1.48.10+ds1-1
ii  libsecret-1-00.20.4-2
ii  shared-mime-info 2.0-1

Versions of packages evince recommends:
ii  dbus-user-session [default-dbus-session-bus]  1.12.20-3
ii  dbus-x11 [dbus-session-bus]   1.12.20-3

Versions of packages evince suggests:
ii  gvfs 1.48.1-2
ii  nautilus-sendto  3.8.6-3.1
ii  poppler-data 0.4.11-1
pn  unrar

-- no debconf information