commit c960714b94809360da89949bc146f52d2cf4b848 Author: CentOS Sources Date: Tue May 17 04:52:25 2022 -0400 import xdg-utils-1.1.3-11.el9 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8036de5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/xdg-utils-1.1.3.tar.gz diff --git a/.xdg-utils.metadata b/.xdg-utils.metadata new file mode 100644 index 0000000..7bb7b47 --- /dev/null +++ b/.xdg-utils.metadata @@ -0,0 +1 @@ +98294cf332c341b85e481d98e9ea59357fe1efc7 SOURCES/xdg-utils-1.1.3.tar.gz diff --git a/SOURCES/xdg-utils-1.1.3-upstream-fixes.patch b/SOURCES/xdg-utils-1.1.3-upstream-fixes.patch new file mode 100644 index 0000000..5e7adc6 --- /dev/null +++ b/SOURCES/xdg-utils-1.1.3-upstream-fixes.patch @@ -0,0 +1,746 @@ +From 0b73fb82ccf178d496bd8da5b8c0a6906b14d030 Mon Sep 17 00:00:00 2001 +From: Rex Dieter +Date: Sun, 13 May 2018 08:40:55 -0500 +Subject: [PATCH 01/16] open for post 1.1.3 development + +--- + ChangeLog | 3 +++ + scripts/xdg-utils-common.in | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index c9eaeea..6864f88 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,6 @@ ++=== xdg-utils 1.1.4 === ++ ++ + === xdg-utils 1.1.3 === + + 2018-05-10 +diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in +index 9cfc8a3..a8abed8 100644 +--- a/scripts/xdg-utils-common.in ++++ b/scripts/xdg-utils-common.in +@@ -245,7 +245,7 @@ check_common_commands() + ;; + + --version) +- echo "@NAME@ 1.1.3" ++ echo "@NAME@ 1.1.3+" + exit_success + ;; + esac +-- +2.33.1 + + +From 31525d3855f876ddf2e29091b2e8d376f923e09e Mon Sep 17 00:00:00 2001 +From: Rex Dieter +Date: Thu, 24 May 2018 14:40:53 -0500 +Subject: [PATCH 02/16] xdg-open: better pcmanfm check (BR106636,BR106161) + +--- + ChangeLog | 2 ++ + scripts/xdg-open.in | 2 +- + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ChangeLog b/ChangeLog +index 6864f88..3eed7c4 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,5 +1,7 @@ + === xdg-utils 1.1.4 === + ++2018-05-24 ++ * xdg-open: better pcmanfm check (BR106636,BR106161) + + === xdg-utils 1.1.3 === + +diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in +index 630e63e..bf9da4c 100644 +--- a/scripts/xdg-open.in ++++ b/scripts/xdg-open.in +@@ -451,7 +451,7 @@ open_lxde() + { + + # pcmanfm only knows how to handle file:// urls and filepaths, it seems. +- if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then ++ if pcmanfm --help >/dev/null 2>&1 && is_file_url_or_path "$1"; then + local file="$(file_url_to_path "$1")" + + # handle relative paths +-- +2.33.1 + + +From 56991bc165577f011f9ad7ca721c5a5134710e33 Mon Sep 17 00:00:00 2001 +From: Alberto Salvia Novella +Date: Tue, 11 Sep 2018 02:26:39 +0200 +Subject: [PATCH 03/16] xdg-email: Support for Deepin + +--- + ChangeLog | 6 ++++++ + scripts/xdg-email.in | 2 +- + scripts/xdg-open.in | 6 +++--- + scripts/xdg-utils-common.in | 5 ++--- + 4 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 3eed7c4..1c6b4c1 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,9 @@ ++=== xdg-utils 1.1.5 === ++ ++2018-09-11 Alberto Salvia Novella ++ * all: Deepin Desktop name standarised as "deepin" ++ * xdg-email: Support for Deepin (BR107877) ++ + === xdg-utils 1.1.4 === + + 2018-05-24 +diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in +index 3614776..6db58ad 100644 +--- a/scripts/xdg-email.in ++++ b/scripts/xdg-email.in +@@ -472,7 +472,7 @@ case "$DE" in + open_gnome "${mailto}" + ;; + +- gnome3|cinnamon|lxde|mate) ++ gnome3|cinnamon|lxde|mate|deepin) + open_gnome3 "${mailto}" + ;; + +diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in +index bf9da4c..4928538 100644 +--- a/scripts/xdg-open.in ++++ b/scripts/xdg-open.in +@@ -142,7 +142,7 @@ open_kde() + fi + } + +-open_dde() ++open_deepin() + { + if dde-open -version >/dev/null 2>&1; then + dde-open "$1" +@@ -524,8 +524,8 @@ case "$DE" in + open_kde "$url" + ;; + +- dde) +- open_dde "$url" ++ deepin) ++ open_deepin "$url" + ;; + + gnome3|cinnamon) +diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in +index a8abed8..7d2c49c 100644 +--- a/scripts/xdg-utils-common.in ++++ b/scripts/xdg-utils-common.in +@@ -288,9 +288,8 @@ detectDE() + KDE) + DE=kde; + ;; +- # Deepin Desktop Environments +- DEEPIN|Deepin|deepin) +- DE=dde; ++ Deepin) ++ DE=deepin; + ;; + LXDE) + DE=lxde; +-- +2.33.1 + + +From 74776910981b60877d25b1ab9587e5928af1e9c4 Mon Sep 17 00:00:00 2001 +From: Rex Dieter +Date: Thu, 13 Sep 2018 10:48:28 -0500 +Subject: [PATCH 04/16] Restore matching of older deepin names + +Reverts a small part of prior commit +56991bc165577f011f9ad7ca721c5a5134710e33 +--- + scripts/xdg-utils-common.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in +index 7d2c49c..b4333e2 100644 +--- a/scripts/xdg-utils-common.in ++++ b/scripts/xdg-utils-common.in +@@ -288,7 +288,7 @@ detectDE() + KDE) + DE=kde; + ;; +- Deepin) ++ DEEPIN|Deepin|deepin) + DE=deepin; + ;; + LXDE) +-- +2.33.1 + + +From 186966735dcccd61afde937118f27043bd084f57 Mon Sep 17 00:00:00 2001 +From: Richard Tollerton +Date: Thu, 10 Jan 2019 15:41:08 -0600 +Subject: [PATCH 05/16] xdg-open: handle file://localhost/ + +Presently, file://localhost/ URLs are totally unsupported: is_file_url_or_path +correctly considers them files, but they are undecoded and hence +check_input_file fails. + +While the standardization surrounding file: URLs is admittedly vague [1], AFAIK, +*all* literature, and other implementations, unambiguously demonstrate that +file://localhost/ should be equivalent to file:///: + +- The "File URI specification" explicitly linked to from the xdg-utils homepage [2] +- RFC 8089 section 1.1 +- RFC 1738 section 3.10 +- Observed implementations of Windows `start`, macOS `open`, Firefox, Chrome, IE + +Fix this by adding some simple carve-outs for file://localhost specifically in +file_url_to_path. + +[1] https://lists.freedesktop.org/archives/xdg/2004-November/003711.html +[2] https://edeproject.org/spec/file-uri-spec.txt + +Signed-off-by: Richard Tollerton +--- + autotests/t-xdg-open.sh | 6 ++++++ + scripts/xdg-open.in | 3 ++- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/autotests/t-xdg-open.sh b/autotests/t-xdg-open.sh +index 810bdc3..0d4b8d2 100755 +--- a/autotests/t-xdg-open.sh ++++ b/autotests/t-xdg-open.sh +@@ -155,3 +155,9 @@ test_generic_open_file 'test#file.txt' + + test_that_it opens files with spaces in their name in generic mode + test_generic_open_file 'test file.txt' ++ ++test_that_it opens file://localhost/ paths ++mock pcmanfm ++touch $LABDIR/file.txt ++run lxde xdg-open file://localhost$(pwd)/$LABDIR/file%2etxt ++assert_run pcmanfm $(pwd)/$LABDIR/file.txt +diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in +index 4928538..09ef6d8 100644 +--- a/scripts/xdg-open.in ++++ b/scripts/xdg-open.in +@@ -84,7 +84,8 @@ is_file_url_or_path() + file_url_to_path() + { + local file="$1" +- if echo "$file" | grep -q '^file:///'; then ++ if echo "$file" | grep -q '^file://\(localhost\)\?/'; then ++ file=${file#file://localhost} + file=${file#file://} + file=${file%%#*} + file=$(echo "$file" | sed -r 's/\?.*$//') +-- +2.33.1 + + +From af7b34a6d3b77b7c9565fa7b396c7da676aa2fec Mon Sep 17 00:00:00 2001 +From: Richard Tollerton +Date: Thu, 10 Jan 2019 16:31:38 -0600 +Subject: [PATCH 06/16] test-lib.sh: run: eat xdg-open's exit code + +It was observed that t-xdg-open.sh exits after only a fraction of the tests have +been run, e.g. + +ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/ +ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/ + - opens a URL with gvfs-open if gio open is missing in GNOME 3, GNOME 2, and Cinnamon +gio: http://www.freedesktop.org/: Operation not supported +make: *** [Makefile:21: t-xdg-open.sh] Error 4 + +Given that some tests are failing on my machine (likely because of the +peculiarities of my archlinux install), the root cause is `set -e`. The nonzero +exit code returned by xdg-open gets returned by run(), which is also returned by +e.g. test_open_url(), which causes the script to exit immediately. + +All test passes/failures at present are being defined by explicit assertions, +not by exit codes, and it seems at least plausible that some xdg-open calls are +meant to fail. So rather than report the nonzero error code, just ignore it, and +trust that the assertions determine the results. + +Signed-off-by: Richard Tollerton +--- + autotests/test-lib.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/autotests/test-lib.sh b/autotests/test-lib.sh +index 5ea01b3..ca3b10b 100644 +--- a/autotests/test-lib.sh ++++ b/autotests/test-lib.sh +@@ -213,7 +213,7 @@ run() { + XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS \ + DISPLAY=x \ + BROWSER="$BROWSER" \ +- $trace ../scripts/$cmd "$@" ++ $trace ../scripts/$cmd "$@" ||: + } + + echo "* Testing that $COMMAND_TESTED" +-- +2.33.1 + + +From 755e1f27c58016507053d192351666862905b3cc Mon Sep 17 00:00:00 2001 +From: Ronan Arraes Jardim Chagas +Date: Tue, 19 Mar 2019 15:12:58 +1030 +Subject: [PATCH 07/16] Fix a bug when xdg-terminal needs gsettings to get the + default terminal + +xdg-terminal is not working when it needs gsettings to obtain the +default terminal. Thus, xdg-terminal cannot be used in MATE, Cinnamon +or GNOME. This issue was already reported in: +https://bugs.freedesktop.org/show_bug.cgi?id=93231 + +Thus, this patch provides a temporary workaround until upstream fixes +it. + +Link: https://bugs.freedesktop.org/show_bug.cgi?id=93231 +Signed-off-by: Simon Lees +--- + scripts/xdg-terminal.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/xdg-terminal.in b/scripts/xdg-terminal.in +index f67897d..221487c 100644 +--- a/scripts/xdg-terminal.in ++++ b/scripts/xdg-terminal.in +@@ -86,8 +86,8 @@ terminal_gsettings() + { + term_schema="$1"; shift + +- term_exec=`gsettings get ${term_schema} exec` +- term_exec_arg=`gsettings get ${term_schema} exec-arg` ++ term_exec=`gsettings get ${term_schema} exec | sed -r "s/^'(.*)'$/\1/"` ++ term_exec_arg=`gsettings get ${term_schema} exec-arg | sed -r "s/^'(.*)'$/\1/"` + + terminal_exec=`which $term_exec 2>/dev/null` + +-- +2.33.1 + + +From acdf8909f2bf65ca20e69ab1e6bc6854d54b333d Mon Sep 17 00:00:00 2001 +From: "sor.alexei@meowr.ru" +Date: Tue, 19 Mar 2019 15:13:38 +1030 +Subject: [PATCH 08/16] Fixes -x argument, which is the default for + {gnome,mate}-terminal + +Signed-off-by: Simon Lees +--- + scripts/xdg-terminal.in | 34 +++++++++++++++++++++++----------- + 1 file changed, 23 insertions(+), 11 deletions(-) + +diff --git a/scripts/xdg-terminal.in b/scripts/xdg-terminal.in +index 221487c..36a9833 100644 +--- a/scripts/xdg-terminal.in ++++ b/scripts/xdg-terminal.in +@@ -65,11 +65,17 @@ terminal_gnome() + if [ x"$1" = x"" ]; then + $terminal_exec + else +- if [ x"$term_exec_arg" = x"" ]; then +- $terminal_exec "$1" +- else +- $terminal_exec "$term_exec_arg" "$1" +- fi ++ case "$term_exec_arg" in ++ "") ++ "$terminal_exec" "$1" ++ ;; ++ *-x*) ++ "$terminal_exec" "$term_exec_arg" sh -c "$1" ++ ;; ++ *) ++ "$terminal_exec" "$term_exec_arg" "$1" ++ ;; ++ esac + fi + + if [ $? -eq 0 ]; then +@@ -93,13 +99,19 @@ terminal_gsettings() + + if [ -x "$terminal_exec" ]; then + if [ x"$1" = x"" ]; then +- $terminal_exec ++ "$terminal_exec" + else +- if [ x"$term_exec_arg" = x"" ]; then +- $terminal_exec "$1" +- else +- $terminal_exec "$term_exec_arg" "$1" +- fi ++ case "$term_exec_arg" in ++ "") ++ "$terminal_exec" "$1" ++ ;; ++ *-x*) ++ "$terminal_exec" "$term_exec_arg" sh -c "$1" ++ ;; ++ *) ++ "$terminal_exec" "$term_exec_arg" "$1" ++ ;; ++ esac + fi + + if [ $? -eq 0 ]; then +-- +2.33.1 + + +From 455d066182546b37984e6b9719bde2347bf6fa94 Mon Sep 17 00:00:00 2001 +From: Iain Lane +Date: Tue, 2 Oct 2018 10:29:03 +0100 +Subject: [PATCH 09/16] xdg-screensaver: Sanitise window name before sending it + over the bus + +libdbus expects string arguments to be valid UTF-8. If they are not, +then it aborts, which causes our backgrounded command to terminate +abnormally. + +Signed-off-by: Simon Lees +--- + scripts/xdg-screensaver.in | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/scripts/xdg-screensaver.in b/scripts/xdg-screensaver.in +index 9e68196..ccb4307 100644 +--- a/scripts/xdg-screensaver.in ++++ b/scripts/xdg-screensaver.in +@@ -468,6 +468,7 @@ screensaver_gnome_screensaver() + perl -e ' + use strict; + use warnings; ++use Encode qw(decode); + use IO::File; + use Net::DBus; + use X11::Protocol; +@@ -489,6 +490,10 @@ while (1) { + } + } + ++# Replace any invalid unicode characters with U+FFFD, so we dont crash when we ++# pass them over to D-Bus ++$window_name = decode("utf8", $window_name, Encode::FB_DEFAULT); ++ + # Inhibit idle detection (flags = 8) with window name and ID. + # We have no reason so just send the window name again. + my $bus = Net::DBus->session(); +-- +2.33.1 + + +From 0801b7104c46ac2eff07bf8b867f7d45c74963c2 Mon Sep 17 00:00:00 2001 +From: Reuben Thomas +Date: Sun, 30 Oct 2016 06:21:53 +0000 +Subject: [PATCH 10/16] xdg-su: fix some easy TODOs + +Although xdg-su is not currently shipped, fix some trivial documentation +TODOs. + +Signed-off-by: Simon Lees +--- + TODO | 3 --- + scripts/desc/xdg-su.xml | 11 ++++++++++- + 2 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/TODO b/TODO +index 183ea6c..a4f3b17 100644 +--- a/TODO ++++ b/TODO +@@ -16,9 +16,6 @@ General + * Add xdg-autostart + + xdg-su: +-* The summary is incorrect, it suggests that it can only run things as +-root which is incorrect according to the main body of the document. +-* The -c option is listed in the synopsis, but not in options. + * It would be useful if it was possible to distinguish between a failure + because of a bad password or some other failure. + * use sudo style syntax, drop -c option +diff --git a/scripts/desc/xdg-su.xml b/scripts/desc/xdg-su.xml +index 53a0f32..b4e1b7e 100644 +--- a/scripts/desc/xdg-su.xml ++++ b/scripts/desc/xdg-su.xml +@@ -30,7 +30,7 @@ + + + xdg-su +- run a GUI program as root after prompting for the root password ++ run a GUI program as another user (typically root) after prompting for that user's password + + + +@@ -67,6 +67,15 @@ + + Options + ++ ++ ++ ++ ++ the command to run. This argument is mandatory. ++ ++ ++ ++ + + + +-- +2.33.1 + + +From 15144f8abd0bfd7de23b18a282f539d1e9c79ef9 Mon Sep 17 00:00:00 2001 +From: Reuben Thomas +Date: Sun, 30 Oct 2016 06:12:45 +0000 +Subject: [PATCH 11/16] xdg-open: fix comment typo +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Also bump Rex Dieter’s copyright date + +Signed-off-by: Simon Lees +--- + scripts/xdg-open.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in +index 09ef6d8..c38e1e0 100644 +--- a/scripts/xdg-open.in ++++ b/scripts/xdg-open.in +@@ -7,7 +7,7 @@ + # Refer to the usage() function below for usage. + # + # Copyright 2009-2010, Fathi Boudra +-# Copyright 2009-2010, Rex Dieter ++# Copyright 2009-2016, Rex Dieter + # Copyright 2006, Kevin Krammer + # Copyright 2006, Jeremy White + # +@@ -510,7 +510,7 @@ fi + + DEBUG 2 "Selected DE $DE" + +-# sanitize BROWSER (avoid caling ourselves in particular) ++# sanitize BROWSER (avoid calling ourselves in particular) + case "${BROWSER}" in + *:"xdg-open"|"xdg-open":*) + BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g') +-- +2.33.1 + + +From 7f5349ea485fa9e0a4cb69dc645fbaf9ce3cec2e Mon Sep 17 00:00:00 2001 +From: mvdlinde +Date: Sun, 3 Mar 2019 16:20:48 +0000 +Subject: [PATCH 12/16] Enable cinnamon screensaver for xdg aware desktop + environments (eg lxqt) + +--- + scripts/xdg-screensaver.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/scripts/xdg-screensaver.in b/scripts/xdg-screensaver.in +index 9e68196..bc5c4ee 100644 +--- a/scripts/xdg-screensaver.in ++++ b/scripts/xdg-screensaver.in +@@ -887,6 +887,8 @@ xscreensaver-command -version 2> /dev/null | grep XScreenSaver > /dev/null && DE + dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.ScreenSaver > /dev/null 2>&1 && DE="gnome_screensaver" + # Consider "mate-screensaver" a separate DE + dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.mate.ScreenSaver > /dev/null 2>&1 && DE="mate_screensaver" ++# Consider "cinnamon-screensaver" a separate DE ++dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.cinnamon.ScreenSaver > /dev/null 2>&1 && DE="cinnamon" + # Consider "xautolock" a separate DE + xautolock -enable > /dev/null 2>&1 && DE="xautolock_screensaver" + +-- +2.33.1 + + +From bfcefa162b1dcd6d62e193019969ff2f5ff331cf Mon Sep 17 00:00:00 2001 +From: Cameron Fieber +Date: Mon, 25 Mar 2019 22:30:25 -0700 +Subject: [PATCH 13/16] support digits in uri scheme regex + +As per RFC 2396[1] a valid URI scheme may contain a digit: + +scheme = alpha *( alpha | digit | + | - | . ) + +[1]: https://www.ietf.org/rfc/rfc2396.txt +--- + scripts/xdg-open.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in +index c38e1e0..202f3e3 100644 +--- a/scripts/xdg-open.in ++++ b/scripts/xdg-open.in +@@ -72,7 +72,7 @@ get_key() + is_file_url_or_path() + { + if echo "$1" | grep -q '^file://' \ +- || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then ++ || ! echo "$1" | egrep -q '^[[:alpha:]][[:alpha:][:digit:]+\.\-]*:'; then + return 0 + else + return 1 +-- +2.33.1 + + +From 0547886c0a7ae79145998495a6e3af6a1450d0c7 Mon Sep 17 00:00:00 2001 +From: Martin Puppe +Date: Sat, 13 Apr 2019 12:46:44 +0200 +Subject: [PATCH 14/16] xdg-mime: return correct exit code for GNOME + +If the desktop environment was GNOME and none of the commands for +detecting the MIME type of a file was available, xdg-mime used to return +exit code 0 even though it failed. The man page says it should return +exit code 3. This commit fixes the issue. + +I have considered returning exit code 4 instead since that is what would +be returned if info_kde() or info_generic() fail to find a tool for MIME +type detection. But I have decided to implement the behavior as +specified in the man page. + +The exit code of an if construct is 0 if no condition +tested true [^1]. The author of the original code probably was not aware +of this. + +[^1]: https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#Conditional-Constructs +--- + scripts/xdg-mime.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in +index 0e567c7..034d0ef 100644 +--- a/scripts/xdg-mime.in ++++ b/scripts/xdg-mime.in +@@ -84,6 +84,8 @@ info_gnome() + elif gnomevfs-info --help 2>/dev/null 1>&2; then + DEBUG 1 "Running gnomevfs-info \"$1\"" + gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "// ++ else ++ exit_failure_operation_impossible "no method available for querying MIME type of '$filename'" + fi + + if [ $? -eq 0 ]; then +-- +2.33.1 + + +From 9816ebb3e6fd9f23e993b8b7fcbd56f92d9c9197 Mon Sep 17 00:00:00 2001 +From: Andrea Tarocchi +Date: Thu, 20 Feb 2020 22:01:04 +0100 +Subject: [PATCH 15/16] fixed #166: xdg-open dose not search correctly in + directories with spaces in the name + +--- + scripts/xdg-mime.in | 2 +- + scripts/xdg-open.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in +index 034d0ef..612d2ce 100644 +--- a/scripts/xdg-mime.in ++++ b/scripts/xdg-mime.in +@@ -307,7 +307,7 @@ search_desktop_file() + + grep -l "$MIME;" "$dir/"*.desktop 2>/dev/null + +- for f in $dir/*/; do ++ for f in "$dir/"*/; do + [ -d "$f" ] && search_desktop_file "$MIME" "$f" + done + } +diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in +index 202f3e3..8de839a 100644 +--- a/scripts/xdg-open.in ++++ b/scripts/xdg-open.in +@@ -328,7 +328,7 @@ search_desktop_file() + fi + fi + +- for d in $dir/*/; do ++ for d in "$dir/"*/; do + [ -d "$d" ] && search_desktop_file "$default" "$d" "$target" + done + } +-- +2.33.1 + + +From d11b33ec7f24cfb1546f6b459611d440013bdc72 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?M=C3=A9ven=20Car?= +Date: Wed, 21 Oct 2020 16:58:20 +0200 +Subject: [PATCH 16/16] Fix xdg-settings support for default-web-browser for + Plasma 5.19+ + +--- + scripts/xdg-settings.in | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + mode change 100644 => 100755 scripts/xdg-settings.in + +diff --git a/scripts/xdg-settings.in b/scripts/xdg-settings.in +old mode 100644 +new mode 100755 +index 3781de8..ab18d3a +--- a/scripts/xdg-settings.in ++++ b/scripts/xdg-settings.in +@@ -130,7 +130,7 @@ set_browser_mime() + fix_local_desktop_file "$1" "$MIME" || return + mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications" + xdg-mime default "$1" "$MIME" || return +- if [ x"`get_browser_mime`" != x"$1" ]; then ++ if [ x"`get_browser_mime $MIME`" != x"$1" ]; then + # Put back the original value + xdg-mime default "$orig" "$MIME" + exit_failure_operation_failed +@@ -203,7 +203,13 @@ resolve_kde_browser_desktop() + + read_kde_browser() + { +- read_kde_config kdeglobals General BrowserApplication ++ ret=`read_kde_config kdeglobals General BrowserApplication` ++ if [ -z "$ret" ]; then ++ # since Plasma >= 5.19 ++ ret=`get_browser_mime "x-scheme-handler/http"` ++ fi ++ ++ echo $ret + } + + get_browser_kde() +@@ -252,7 +258,13 @@ check_browser_kde() + + set_browser_kde() + { +- set_browser_mime "$1" || return ++ # Set the default browser. ++ for protocol in http https; do ++ set_browser_mime "$1" "x-scheme-handler/$protocol" || return ++ done ++ ++ # Plasma < 5.19 ++ set_browser_mime "$1" "text/html" || return + if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then + kwriteconfig5 --file kdeglobals --group General --key BrowserApplication "$1" + else +-- +2.33.1 + diff --git a/SOURCES/xdg-utils-git_checkout.sh b/SOURCES/xdg-utils-git_checkout.sh new file mode 100755 index 0000000..b00452a --- /dev/null +++ b/SOURCES/xdg-utils-git_checkout.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +MODULE=xdg-utils +VERSION=1.1.0 +DATE=$(date +%Y%m%d)git + +set -x + +rm -rf $MODULE + +git clone git://anongit.freedesktop.org/git/xdg/xdg-utils $MODULE/ +pushd $MODULE +git archive master --format tar --prefix=${MODULE}-${VERSION}/ | gzip -9 > ../${MODULE}-${VERSION}-${DATE}.tar.gz +popd + +rm -rf $MODULE diff --git a/SPECS/xdg-utils.spec b/SPECS/xdg-utils.spec new file mode 100644 index 0000000..37309d9 --- /dev/null +++ b/SPECS/xdg-utils.spec @@ -0,0 +1,407 @@ + +Summary: Basic desktop integration functions +Name: xdg-utils +Version: 1.1.3 +Release: 11%{?dist} + +URL: http://portland.freedesktop.org/ +%if 0%{?snap:1} +Source0: xdg-utils-%{version}-%{snap}.tar.gz +%else +# at least until freedesktop folks move over to release dir +Source0: https://people.freedesktop.org/~rdieter/xdg-utils/xdg-utils-%{version}.tar.gz +#Source0: http://portland.freedesktop.org/download/xdg-utils-%{version}%{?prerelease:-%{prerelease}}.tar.gz +%endif +Source1: xdg-utils-git_checkout.sh +License: MIT + +# upstream patches +Patch0: xdg-utils-1.1.3-upstream-fixes.patch + +# make sure BuildArch comes *after* patches, to ensure %%autosetup works right +# http://bugzilla.redhat.com/1084309 +BuildArch: noarch + +BuildRequires: make +BuildRequires: gawk +BuildRequires: xmlto lynx + +Requires: coreutils +Requires: desktop-file-utils +Requires: which + +%description +The %{name} package is a set of simple scripts that provide basic +desktop integration functions for any Free Desktop, such as Linux. +They are intended to provide a set of defacto standards. +This means that: +* Third party software developers can rely on these xdg-utils + for all of their simple integration needs. +* Developers of desktop environments can make sure that their + environments are well supported +* Distribution vendors can provide custom versions of these utilities + +The following scripts are provided at this time: +* xdg-desktop-icon Install icons to the desktop +* xdg-desktop-menu Install desktop menu items +* xdg-email Send mail using the user's preferred e-mail composer +* xdg-icon-resource Install icon resources +* xdg-mime Query information about file type handling and + install descriptions for new file types +* xdg-open Open a file or URL in the user's preferred application +* xdg-screensaver Control the screensaver +* xdg-settings Get various settings from the desktop environment + + +%prep +%autosetup -n %{name}-%{version}%{?pre:-%{pre}} -p1 + + +%build +%configure + +%if 0%{?snap:1} +make scripts-clean -C scripts +make man scripts %{?_smp_mflags} -C scripts +%endif +make %{?_smp_mflags} + + +%install +make install DESTDIR=%{buildroot} + + +%files +%doc ChangeLog LICENSE README TODO +%{_bindir}/xdg-desktop-icon +%{_bindir}/xdg-desktop-menu +%{_bindir}/xdg-email +%{_bindir}/xdg-icon-resource +%{_bindir}/xdg-mime +%{_bindir}/xdg-open +%{_bindir}/xdg-screensaver +%{_bindir}/xdg-settings +%{_mandir}/man1/xdg-desktop-icon.1* +%{_mandir}/man1/xdg-desktop-menu.1* +%{_mandir}/man1/xdg-email.1* +%{_mandir}/man1/xdg-icon-resource.1* +%{_mandir}/man1/xdg-mime.1* +%{_mandir}/man1/xdg-open.1* +%{_mandir}/man1/xdg-screensaver.1* +%{_mandir}/man1/xdg-settings.1* + + +%changelog +* Tue Nov 23 2021 David King - 1.1.3-11 +- Pull in upstream fixes (#1881372) + +* Tue Aug 10 2021 Mohan Boddu - 1.1.3-10 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Apr 16 2021 Mohan Boddu - 1.1.3-9 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.1.3-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 1.1.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jan 31 2020 Fedora Release Engineering - 1.1.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sat Jul 27 2019 Fedora Release Engineering - 1.1.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 03 2019 Fedora Release Engineering - 1.1.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 1.1.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu May 24 2018 Rex Dieter - 1.1.3-2 +- pull in upstream fixes + +* Thu May 10 2018 Rex Dieter - 1.1.3-1 +- xdg-utils-1.1.3 + +* Tue Feb 27 2018 Rex Dieter - 1.1.2-4 +- pull in upstream fixes + +* Fri Feb 09 2018 Fedora Release Engineering - 1.1.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 08 2017 Rex Dieter - 1.1.2-1 +- xdg-utils-1.1.2 + +* Mon Feb 06 2017 Rex Dieter - 1.1.1-5 +- pull in upstream fixes + +* Thu May 05 2016 Rex Dieter 1.1.1-4 +- save mimetype defaults to ~/.config/mimeapps.list + (instead of ~/.local/share/applications/mimeapps.list) + +* Fri Apr 15 2016 Rex Dieter - 1.1.1-3 +- pull in latest upstream fixes + +* Fri Feb 05 2016 Fedora Release Engineering - 1.1.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Oct 05 2015 Rex Dieter 1.1.1-1 +- 1.1.1 + +* Mon Oct 05 2015 Rex Dieter 1.1.0-1 +- 1.1.0 (final) + +* Wed Sep 30 2015 Rex Dieter 1.1.0-0.42.20150927git +- 20150927git snapshot + +* Wed Jul 15 2015 Rex Dieter 1.1.0-0.41.20150715git +- 20150715git snapshot + +* Fri Jun 19 2015 Fedora Release Engineering - 1.1.0-0.40.rc3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Feb 24 2015 Rex Dieter 1.1.0-0.39.rc3 +- 'xdg-mime query default' return multiple .desktop entries (fdo#60329,#1195718) + +* Sat Feb 21 2015 Rex Dieter 1.1.0-0.38.rc3 +- minor s/$arg/$target/ fix for prior commit + +* Fri Feb 20 2015 Rex Dieter 1.1.0-0.37.rc3 +- xdg-open wrongly passes all command line arguments as one argument to e.g. okular on non Gnome desktops (#1191981) + +* Mon Jan 19 2015 Rex Dieter 1.1.0-0.36.rc3 +- pull in upstream performance improvement (fdo#88524) + +* Mon Jan 19 2015 Rex Dieter 1.1.0-0.35.rc3 +- pull in latest commits, notably more fdo screensaver fixes + +* Tue Jan 06 2015 Rex Dieter 1.1.0-0.34.rc3 +- refresh for latest attepmt to fix upstream BR66670 + +* Mon Jan 05 2015 Rex Dieter 1.1.0-0.33.rc3 +- pull in latest commits + +* Sat Jan 03 2015 Rex Dieter 1.1.0-0.32.rc3 +- xdg-utils-1.1.0-rc3 + +* Tue Oct 21 2014 Rex Dieter 1.1.0-0.31.rc2 +- workaround %%autosetup failure harder (#1084309) + +* Mon Oct 20 2014 Rex Dieter 1.1.0-0.30.rc2 +- workaround %%autosetup failure, again (#1084309) + +* Thu Oct 09 2014 Rex Dieter 1.1.0-0.29.rc2 +- xdg-screensaver plasma5 support + +* Mon Sep 22 2014 Rex Dieter 1.1.0-0.28.rc2 +- plasma5: ktraderclient5, kreadconfig5, kwriteconfig5 + +* Mon Sep 22 2014 Rex Dieter 1.1.0-0.27.rc2 +- more upstream goodness, initial plasma5 support + +* Sat Sep 20 2014 Rex Dieter 1.1.0-0.26.rc2 +- pull in latest upstream fixes + +* Sun Jun 08 2014 Fedora Release Engineering - 1.1.0-0.25.rc2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Apr 15 2014 Till Maas - 1.1.0-0.24.rc2 +- Fix patch from 1.1.0-0.23.rc2 (#1086122) + +* Fri Apr 11 2014 Till Maas - 1.1.0-0.23.rc2 +- Fix handling of desktop files with multiple groups (#1086122) + +* Fri Apr 04 2014 Rex Dieter 1.1.0-0.22.rc2 +- drop using %%autosetup (it didn't work?) + +* Sun Mar 30 2014 Rex Dieter - 1.1.0-0.21.rc2 +- .spec housecleaning (remove deprecated stuff) +- pull in latest upstream fixes, including... +- xdg-open does not substitute all field codes in Exec key (#1056431, fdo#49204) + +* Fri Feb 07 2014 Rex Dieter 1.1.0-0.20.rc2 +- 1.1.0-rc2 + +* Sat Oct 05 2013 Rex Dieter 1.1.0-0.18.20131005git +- 20131005 snapshot + +* Mon Aug 05 2013 Rex Dieter 1.1.0-0.17.20120809git +- BR: text-www-browser (#992895) + +* Sun Aug 04 2013 Fedora Release Engineering - 1.1.0-0.16.20120809git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Feb 15 2013 Fedora Release Engineering - 1.1.0-0.15.20120809git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Aug 09 2012 Rex Dieter 1.1.0-0.14.20120809git +- 20120809 snapshot + +* Sun Jul 22 2012 Fedora Release Engineering - 1.1.0-0.13.20120302git +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Mar 02 2012 Rex Dieter 1.1.0-0.12.20120302git +- 20120302 snapshot +- patches for unknown DE (#769305) + +* Sat Jan 14 2012 Fedora Release Engineering - 1.1.0-0.11.20111207 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Dec 07 2011 Rex Dieter 1.1.0-0.10.20110714git +- fix gnome-screensaver detection bogosity (#702540,#736159) +- xdg-open: x-www-browser: command not found (#755553) +- drop htmlview hackage + +* Thu Jul 14 2011 Rex Dieter 1.1.0-0.9.20110714 +- 20110714 snapshot +- xdg-mime : use 'file --mime-type' instead of 'file -i' + +* Thu Jun 16 2011 Rex Dieter 1.1.0-0.8.20110510 +- rebuild + +* Thu Jun 02 2011 Rex Dieter 1.1.0-0.7.20110510 +- fix gnome3 detection, gnome-default-applications-properties error output + +* Thu May 05 2011 Rex Dieter 1.1.0-0.6.20110505 +- Error in xdg-open script (#702347) + +* Wed May 04 2011 Rex Dieter 1.1.0-0.5.20110504 +- 20110504 snapshot +- xdg-email does not work (#690840) + +* Fri Apr 08 2011 Rex Dieter 1.1.0-0.4.20110408 +- 20110408 snapshot +- Shouldn't use user's defaults.list (#678656) + +* Mon Feb 07 2011 Fedora Release Engineering - 1.1.0-0.3.20110201 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Feb 01 2011 Rex Dieter 1.1.0-0.2.20110201 +- 20110201 snapshot +- add gnome3 support, make default browser work again for xdg-settings (#654746) + +* Mon Jan 03 2011 Rex Dieter - 1.1.0-0.1.rc1 +- xdg-utils-1.1.0-rc1 + +* Thu Oct 28 2010 Rex Dieter - 1.0.2-21.20101028 +- lxde support (#580835, fdo#26058)) + +* Fri Jul 09 2010 Rex Dieter - 1.0.2-20.20100709 +- xdg-screensaver: consider gnome-screensaver a separate DE (fdo#20027) + +* Fri Jul 09 2010 Rex Dieter - 1.0.2-19.20100709 +- xdg-open man page needs updating to include FILE and SEE ALSO (#603841) +- xdg-open should call mimeopen with -L option (#430072) +- xdg-desktop-icon : use localized desktop folder name (fdo#19011) + +* Fri Apr 09 2010 Rex Dieter - 1.0.2-18.20100409 +- xdg-settings fixes (#580715, fdo#26284) + +* Mon Jan 18 2010 Rex Dieter - 1.0.2-17.20100118cvs +- xdg-screensaver resume activates the screensaver on KDE4 (fdo#26085) + +* Thu Dec 17 2009 Rex Dieter - 1.0.2-16.20091217cvs +- xdg-mime: line 531: kde-config: command not found (#545702) +- xdg-email calls gconftool which doesn't exist (#548529) + +* Mon Nov 30 2009 Rex Dieter - 1.0.2-15.20091016cvs +- add Obsoletes: htmlview (#541179, f13+) + +* Fri Oct 16 2009 Rex Dieter - 1.0.2-14.20091016cvs +- prefer gvfs-open over gnome-open (#529287) +- DE=gnome, if org.gnome.SessionManager exists on dbus (#529287) + +* Mon Sep 28 2009 Rex Dieter - 1.0.2-13.20090928cvs +- xdg-open: use kde-open + +* Mon Sep 21 2009 Rex Dieter - 1.0.2-12.20090921cvs +- suppress stderr from kde-config (#524724) + +* Sun Sep 13 2009 Rex Dieter - 1.0.2-11.20090913cvs +- 20090913cvs snapshot +- xdg-open in xdg-utils expects xprop to be available (#506857) + +* Mon Aug 24 2009 Rex Dieter - 1.0.2-10.20090824cvs +- 20090824cvs snapshot + +* Mon Jul 27 2009 Fedora Release Engineering - 1.0.2-9.20081121cvs +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Apr 09 2009 Rex Dieter - 1.0.2-8.20081121cvs +- revert. kfmclient openURL is largely useless + +* Wed Apr 08 2009 Rex Dieter - 1.0.2-7.20081121cvs +- xdg-open: s/kfmclient exec/kfmclient openURL/ (CVE-2009-0068, rh#472010, fdo#19377) + +* Thu Feb 26 2009 Fedora Release Engineering - 1.0.2-6.20081121cvs +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Nov 21 2008 Rex Dieter 1.0.2-5.20081121cvs +- upstreamed a few more patches, rebase to cvs snapshot + +* Fri Jan 25 2008 Lubomir Kundrak 1.0.2-4 +- Fix for CVE-2008-0386 (#429513) + +* Fri Jan 18 2008 Rex Dieter 1.0.2-3 +- fix mimeopen support (#429280) +- spec cosmetics: cleanup macro usage + +* Wed Oct 03 2007 Rex Dieter 1.0.2-2 +- Requires: which (#312601) + +* Sun Jun 24 2007 Rex Dieter 1.0.2-1 +- xdg-utils-1.0.2 + +* Mon Apr 23 2007 Rex Dieter 1.0.1-3 +- add htmlview,links to browser fallbacks + +* Tue Dec 19 2006 Rex Dieter 1.0.1-2 +- fix typo in xdg-icon-resource manpage + +* Mon Nov 06 2006 Rex Dieter 1.0.1-1 +- xdg-utils-1.0.1 + +* Tue Oct 24 2006 Rex Dieter 1.0-2 +- prefer mimeopen as generic default (#210797) + +* Tue Oct 10 2006 Rex Dieter 1.0-1 +- 1.0(final) + +* Mon Oct 02 2006 Rex Dieter 1.0-0.9.rc1 +- update %%description (#208926) + +* Wed Sep 20 2006 Rex Dieter 1.0-0.8.rc1 +- 1.0rc1 + +* Fri Sep 15 2006 Rex Dieter 1.0-0.7.beta4 +- 1.0beta4 + +* Mon Aug 21 2006 Rex Dieter 1.0-0.6.beta3 +- 1.0beta3 + +* Thu Jul 27 2006 Rex Dieter 1.0-0.5.20060721 +- Release: append/use %%{?dist} + +* Wed Jul 26 2006 Rex Dieter 1.0-0.4.20060721 +- specfile cosmetics, tabs -> spaces +- %%makeinstall -> make install DESTDIR=... + +* Mon Jul 24 2006 Rex Dieter 1.0-0.3.20060721 +- 20060721 snapshot +- optgnome.patch + +* Mon Jul 24 2006 Rex Dieter 1.0-0.2.beta1 +- Requires: desktop-file-utils + +* Mon Jul 24 2006 Rex Dieter 1.0-0.1.beta1 +- 1.0beta1 +