diff --git a/common-vendor-dirs-in-desktop_to_binary.patch b/common-vendor-dirs-in-desktop_to_binary.patch new file mode 100644 index 0000000..18484a0 --- /dev/null +++ b/common-vendor-dirs-in-desktop_to_binary.patch @@ -0,0 +1,59 @@ +commit 6e4d88e740b89a2766312fb544e4a22b7034d9e3 +Author: Simon Lees +Date: Tue May 31 13:13:53 2016 +0930 + + common: implement vendor dirs in desktop_file_to_binary + +diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in +index cf08cd3..19400a4 100644 +--- a/scripts/xdg-utils-common.in ++++ b/scripts/xdg-utils-common.in +@@ -50,7 +50,6 @@ binary_to_desktop_file() + + #------------------------------------------------------------- + # map a .desktop file to a binary +-## FIXME: handle vendor dir case + desktop_file_to_binary() + { + search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" +@@ -58,14 +57,32 @@ desktop_file_to_binary() + IFS=: + for dir in $search; do + unset IFS +- [ "$dir" ] && [ -d "$dir/applications" ] || continue +- file="$dir/applications/$desktop" +- [ -r "$file" ] || continue +- # Remove any arguments (%F, %f, %U, %u, etc.). +- command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" +- command="`which "$command"`" +- readlink -f "$command" +- return ++ [ "$dir" ] && [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue ++ # Check if desktop file contains - ++ if [ "${desktop#*-}" != "$desktop" ]; then ++ vendor=${desktop%-*} ++ app=${desktop#*-} ++ if [ -r $dir/applications/$vendor/$app ]; then ++ file_path=$dir/applications/$vendor/$app ++ elif [ -r $dir/applnk/$vendor/$app ]; then ++ file_path=$dir/applnk/$vendor/$app ++ fi ++ else ++ for indir in "$dir"/applications/ "$dir"/applications/*/ "$dir"/applnk/ "$dir"/applnk/*/; do ++ file="$indir/$desktop" ++ if [ -r "$file" ]; then ++ file_path=$file ++ break ++ fi ++ done ++ fi ++ if [ -r "$file_path" ]; then ++ # Remove any arguments (%F, %f, %U, %u, etc.). ++ command="`grep -E "^Exec(\[[^]=]*])?=" "$file_path" | cut -d= -f 2- | first_word`" ++ command="`which "$command"`" ++ readlink -f "$command" ++ return ++ fi + done + } + diff --git a/xdg-mime-return-existing-desktop-files.patch b/xdg-mime-return-existing-desktop-files.patch new file mode 100644 index 0000000..89592a2 --- /dev/null +++ b/xdg-mime-return-existing-desktop-files.patch @@ -0,0 +1,36 @@ +commit 88deef3f4affa53680382540c2cd1ba9ce8e082d +Author: Simon Lees +Date: Fri Jun 3 16:45:08 2016 +0930 + + xdg-mime only return desktop file for existing apps + + xdg-mime originally returned whatever was in the mimeapps.list + file, now it only returns the first desktop file that exists + and has a corrosponding binary that exists. + + fdo#44163 + +Index: xdg-utils-20160520/scripts/xdg-mime.in +=================================================================== +--- xdg-utils-20160520.orig/scripts/xdg-mime.in ++++ xdg-utils-20160520/scripts/xdg-mime.in +@@ -372,8 +372,17 @@ check_mimeapps_list() + } + ' "$mimeapps_list" | cut -d ';' -f 1) + if [ -n "$result" ]; then +- echo "$result" +- exit_success ++ # $result could be a ; separated list of .desktop files ++ # use the first on the system ++ IFS=\; ++ for app in $result; do ++ IFS="$oldifs" ++ exists=$(desktop_file_to_binary "$app") ++ if [ -n "$exists" ]; then ++ echo "$app" ++ exit_success ++ fi ++ done + fi + fi + done diff --git a/xdg-utils-20151219.tar.xz b/xdg-utils-20151219.tar.xz deleted file mode 100644 index 452d457..0000000 --- a/xdg-utils-20151219.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5428951007586943edc65308aee15c5b7888bae8939a164c69212b7d60425440 -size 268204 diff --git a/xdg-utils-20160520.tar.xz b/xdg-utils-20160520.tar.xz new file mode 100644 index 0000000..8f0fc2e --- /dev/null +++ b/xdg-utils-20160520.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d1967e9f1d546377182a45eeade0859a97f9b564f3073085b3c2d78de89681b +size 268508 diff --git a/xdg-utils.changes b/xdg-utils.changes index 4c9fcbb..e8c7af6 100644 --- a/xdg-utils.changes +++ b/xdg-utils.changes @@ -1,3 +1,14 @@ +Fri May 20 04:54:39 UTC 2016 - sflees@suse.de + +- Update to 20160520 + * xdg-mime: support for KDE Frameworks 5.6 + * xdg-mime does not write the file it reads in a query (BR95051) + * xdg-screensaver: Add cinnamon-screensaver D-Bus API support. + * xdg-open: standardize output redirection style +- Fix issues related to xdg-open/xdg-mime generic code paths. + * xdg-common-desktop-bin-vendor-dir.patch + * xdg-mime-return-existing-desktop-files.patch + ------------------------------------------------------------------- Sat Feb 6 11:12:43 UTC 2016 - sor.alexei@meowr.ru diff --git a/xdg-utils.spec b/xdg-utils.spec index a694259..9916d06 100644 --- a/xdg-utils.spec +++ b/xdg-utils.spec @@ -17,7 +17,7 @@ Name: xdg-utils -Version: 20151219 +Version: 20160520 Release: 0 Summary: Utilities to uniformly interface desktop environments License: MIT @@ -33,6 +33,9 @@ Patch1: xdg-terminal-fix-gsettings.patch Patch2: fix-enlightenment-support.patch # PATCH-FIX-UPSTREAM xdg-terminal-fix-terminal--x-arg.patch fdo#93231 sor.alexei@meowr.ru -- https://bugs.freedesktop.org/show_bug.cgi?id=93231#c5 Patch3: xdg-terminal-fix-terminal--x-arg.patch +# PATCH-FIX-UPSTREAM (2 patches) xdg-mime / xdg-open generic implementations only return 1 item sflees@suse.de (boo#979265) +Patch4: common-vendor-dirs-in-desktop_to_binary.patch +Patch5: xdg-mime-return-existing-desktop-files.patch BuildRequires: make # for xmlto to be able to generate text from html BuildRequires: w3m @@ -71,6 +74,8 @@ This means that: %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build %configure