I was trying to open a magnet link into transmission-qt directly
from chromium.

As of now it does not work, because xdg-open makes confusion between
the "Name" field from "[Desktop Entry]" and the "Name" field from
"[Desktop Action Minimize]" when parsing transmission-qt.desktop.

The bug is caused by a bashism and it was already fixed upstream.

Unfortunately, I cannot use a dist patch: it doesn't apply correctly
as they have bumped version to 1.1.0-rc3 in the meantime :(

See: 
http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=48545132620f85d3ba133010116884a63f26f3a3

OK for the diff below?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/xdg-utils/Makefile,v
retrieving revision 1.25
diff -u -p -u -p -r1.25 Makefile
--- Makefile    28 Aug 2014 10:26:20 -0000      1.25
+++ Makefile    30 Oct 2014 12:19:45 -0000
@@ -8,6 +8,7 @@ COMMENT=        utilities to assist desktop int
 
 DISTNAME=      xdg-utils-1.1.0-rc2
 PKGNAME=       xdg-utils-1.1.0rc2
+REVISION=      0
 
 DIST_SUBDIR=   xdg-utils
 MASTER_SITES0= http://cgit.freedesktop.org/xdg/xdg-utils/patch/?id=
Index: patches/patch-scripts_xdg-open_in
===================================================================
RCS file: /cvs/ports/devel/xdg-utils/patches/patch-scripts_xdg-open_in,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-scripts_xdg-open_in
--- patches/patch-scripts_xdg-open_in   28 Aug 2014 10:26:21 -0000      1.1
+++ patches/patch-scripts_xdg-open_in   30 Oct 2014 12:19:45 -0000
@@ -1,9 +1,21 @@
 $OpenBSD: patch-scripts_xdg-open_in,v 1.1 2014/08/28 10:26:21 ajacoutot Exp $
 
+xdg-open uses bashism
+(upstream git commit 48545132620f85d3ba133010116884a63f26f3a3)
+
 Fix sed(1) usage (i.e. !GNU sed).
 
---- scripts/xdg-open.in.orig   Thu Aug 28 12:24:07 2014
-+++ scripts/xdg-open.in        Thu Aug 28 12:24:24 2014
+--- scripts/xdg-open.in.orig   Thu Oct 30 13:12:54 2014
++++ scripts/xdg-open.in        Thu Oct 30 13:15:06 2014
+@@ -54,7 +54,7 @@ get_key()
+                 desktop_entry="y"
+             ;;
+             # Reset match flag for other groups
+-            [*)
++            "["*)
+                 desktop_entry=""
+             ;;
+             *)
 @@ -228,7 +228,7 @@ DEBUG 3 "$xdg_user_dir:$xdg_system_dirs"
  
  open_generic_xdg_file_mime()

Reply via email to