Package: mime-support
Version: 3.54
Severity: normal

mutt fails to open an image with the following error message:
 gwenview: '<caption>' missing.
 gwenview: Use --help to get a list of available command line options.

This is caused by update-mime creating a mailcap file, which still
contains "-caption %s":

$ grep -m1 image/gif /etc/mailcap
image/gif; gwenview %s -caption %c %i; test=test -n "$DISPLAY"

This is copied from the original .desktop entry:
$ grep ^Exec /usr/share/applications/kde4/gwenview.desktop 
Exec=gwenview %U -caption %c %i

According to
<http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables>
%c should be replaced by the (translated) name of the application.

The attached patch replaces the %c with the (untranslated) name.

This fixed the problem for me and makes mutt work again.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.13.9 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

mime-support depends on no packages.

Versions of packages mime-support recommends:
ii  file  1:5.17-1

mime-support suggests no packages.

-- no debconf information
--- /usr/sbin/update-mime	2013-05-11 15:17:57.000000000 +0200
+++ update-mime	2014-04-18 15:47:38.717813307 +0200
@@ -135,13 +135,16 @@
 		$packages{$pkg} = [];
 
 		if (open(FILE,"<$file")) {
-			my($terminal, $exec, @types) = ("test=test -n \"\$DISPLAY\"");
+			my($terminal, $name, $exec, @types) = ("test=test -n \"\$DISPLAY\"", $pkg);
 			while (<FILE>) {
 				chomp;
 				next if (m/^\s*$|^\s*\#/);
 				if (m/^Terminal=(\w+)/i) {
 					$terminal = "needsterminal" if ($1 eq "true");
 				}
+				elsif (m/^Name=(.+)/i) {
+					$name = $1;
+				}
 				elsif (m/Exec=(.*)$/i) {
 					$exec = $1;
 					$exec =~ s/%[fFuU]/%s/g;
@@ -155,6 +158,7 @@
 				close(FILE);
 				next;
 			}
+			$exec =~ s/%c/$name/g;
 			foreach $type (@types) {
 				my $entry = "$type; $exec; $terminal";
 				$priority=$defpriority;

Reply via email to