Blame SOURCES/xdg-utils-1.1.3-upstream-fixes.patch

56ce6d
From 0b73fb82ccf178d496bd8da5b8c0a6906b14d030 Mon Sep 17 00:00:00 2001
56ce6d
From: Rex Dieter <rdieter@gmail.com>
56ce6d
Date: Sun, 13 May 2018 08:40:55 -0500
56ce6d
Subject: [PATCH 01/16] open for post 1.1.3 development
56ce6d
56ce6d
---
56ce6d
 ChangeLog                   | 3 +++
56ce6d
 scripts/xdg-utils-common.in | 2 +-
56ce6d
 2 files changed, 4 insertions(+), 1 deletion(-)
56ce6d
56ce6d
diff --git a/ChangeLog b/ChangeLog
56ce6d
index c9eaeea..6864f88 100644
56ce6d
--- a/ChangeLog
56ce6d
+++ b/ChangeLog
56ce6d
@@ -1,3 +1,6 @@
56ce6d
+=== xdg-utils 1.1.4 ===
56ce6d
+
56ce6d
+
56ce6d
 === xdg-utils 1.1.3 ===
56ce6d
 
56ce6d
 2018-05-10
56ce6d
diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in
56ce6d
index 9cfc8a3..a8abed8 100644
56ce6d
--- a/scripts/xdg-utils-common.in
56ce6d
+++ b/scripts/xdg-utils-common.in
56ce6d
@@ -245,7 +245,7 @@ check_common_commands()
56ce6d
             ;;
56ce6d
 
56ce6d
             --version)
56ce6d
-            echo "@NAME@ 1.1.3"
56ce6d
+            echo "@NAME@ 1.1.3+"
56ce6d
             exit_success
56ce6d
             ;;
56ce6d
         esac
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 31525d3855f876ddf2e29091b2e8d376f923e09e Mon Sep 17 00:00:00 2001
56ce6d
From: Rex Dieter <rdieter@gmail.com>
56ce6d
Date: Thu, 24 May 2018 14:40:53 -0500
56ce6d
Subject: [PATCH 02/16] xdg-open: better pcmanfm check (BR106636,BR106161)
56ce6d
56ce6d
---
56ce6d
 ChangeLog           | 2 ++
56ce6d
 scripts/xdg-open.in | 2 +-
56ce6d
 2 files changed, 3 insertions(+), 1 deletion(-)
56ce6d
56ce6d
diff --git a/ChangeLog b/ChangeLog
56ce6d
index 6864f88..3eed7c4 100644
56ce6d
--- a/ChangeLog
56ce6d
+++ b/ChangeLog
56ce6d
@@ -1,5 +1,7 @@
56ce6d
 === xdg-utils 1.1.4 ===
56ce6d
 
56ce6d
+2018-05-24
56ce6d
+   * xdg-open: better pcmanfm check (BR106636,BR106161)
56ce6d
 
56ce6d
 === xdg-utils 1.1.3 ===
56ce6d
 
56ce6d
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
56ce6d
index 630e63e..bf9da4c 100644
56ce6d
--- a/scripts/xdg-open.in
56ce6d
+++ b/scripts/xdg-open.in
56ce6d
@@ -451,7 +451,7 @@ open_lxde()
56ce6d
 {
56ce6d
 
56ce6d
     # pcmanfm only knows how to handle file:// urls and filepaths, it seems.
56ce6d
-    if pcmanfm --help >/dev/null 2>&1 -a is_file_url_or_path "$1"; then
56ce6d
+    if pcmanfm --help >/dev/null 2>&1 && is_file_url_or_path "$1"; then
56ce6d
         local file="$(file_url_to_path "$1")"
56ce6d
 
56ce6d
         # handle relative paths
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 56991bc165577f011f9ad7ca721c5a5134710e33 Mon Sep 17 00:00:00 2001
56ce6d
From: Alberto Salvia Novella <es20490446e@gmail.com>
56ce6d
Date: Tue, 11 Sep 2018 02:26:39 +0200
56ce6d
Subject: [PATCH 03/16] xdg-email: Support for Deepin
56ce6d
56ce6d
---
56ce6d
 ChangeLog                   | 6 ++++++
56ce6d
 scripts/xdg-email.in        | 2 +-
56ce6d
 scripts/xdg-open.in         | 6 +++---
56ce6d
 scripts/xdg-utils-common.in | 5 ++---
56ce6d
 4 files changed, 12 insertions(+), 7 deletions(-)
56ce6d
56ce6d
diff --git a/ChangeLog b/ChangeLog
56ce6d
index 3eed7c4..1c6b4c1 100644
56ce6d
--- a/ChangeLog
56ce6d
+++ b/ChangeLog
56ce6d
@@ -1,3 +1,9 @@
56ce6d
+=== xdg-utils 1.1.5 ===
56ce6d
+	
56ce6d
+2018-09-11 Alberto Salvia Novella <es20490446e@gmail.com>
56ce6d
+   * all: Deepin Desktop name standarised as "deepin"
56ce6d
+   * xdg-email: Support for Deepin (BR107877)
56ce6d
+
56ce6d
 === xdg-utils 1.1.4 ===
56ce6d
 
56ce6d
 2018-05-24
56ce6d
diff --git a/scripts/xdg-email.in b/scripts/xdg-email.in
56ce6d
index 3614776..6db58ad 100644
56ce6d
--- a/scripts/xdg-email.in
56ce6d
+++ b/scripts/xdg-email.in
56ce6d
@@ -472,7 +472,7 @@ case "$DE" in
56ce6d
     open_gnome "${mailto}"
56ce6d
     ;;
56ce6d
 
56ce6d
-    gnome3|cinnamon|lxde|mate)
56ce6d
+    gnome3|cinnamon|lxde|mate|deepin)
56ce6d
     open_gnome3 "${mailto}"
56ce6d
     ;;
56ce6d
 
56ce6d
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
56ce6d
index bf9da4c..4928538 100644
56ce6d
--- a/scripts/xdg-open.in
56ce6d
+++ b/scripts/xdg-open.in
56ce6d
@@ -142,7 +142,7 @@ open_kde()
56ce6d
     fi
56ce6d
 }
56ce6d
 
56ce6d
-open_dde()
56ce6d
+open_deepin()
56ce6d
 {
56ce6d
     if dde-open -version >/dev/null 2>&1; then
56ce6d
         dde-open "$1"
56ce6d
@@ -524,8 +524,8 @@ case "$DE" in
56ce6d
     open_kde "$url"
56ce6d
     ;;
56ce6d
 
56ce6d
-    dde)
56ce6d
-    open_dde "$url"
56ce6d
+    deepin)
56ce6d
+    open_deepin "$url"
56ce6d
     ;;
56ce6d
 
56ce6d
     gnome3|cinnamon)
56ce6d
diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in
56ce6d
index a8abed8..7d2c49c 100644
56ce6d
--- a/scripts/xdg-utils-common.in
56ce6d
+++ b/scripts/xdg-utils-common.in
56ce6d
@@ -288,9 +288,8 @@ detectDE()
56ce6d
          KDE)
56ce6d
            DE=kde;
56ce6d
            ;;
56ce6d
-         # Deepin Desktop Environments
56ce6d
-         DEEPIN|Deepin|deepin)
56ce6d
-           DE=dde;
56ce6d
+         Deepin)
56ce6d
+           DE=deepin;
56ce6d
            ;;
56ce6d
          LXDE)
56ce6d
            DE=lxde;
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 74776910981b60877d25b1ab9587e5928af1e9c4 Mon Sep 17 00:00:00 2001
56ce6d
From: Rex Dieter <rdieter@gmail.com>
56ce6d
Date: Thu, 13 Sep 2018 10:48:28 -0500
56ce6d
Subject: [PATCH 04/16] Restore matching of older deepin names
56ce6d
56ce6d
Reverts a small part of prior commit
56ce6d
56991bc165577f011f9ad7ca721c5a5134710e33
56ce6d
---
56ce6d
 scripts/xdg-utils-common.in | 2 +-
56ce6d
 1 file changed, 1 insertion(+), 1 deletion(-)
56ce6d
56ce6d
diff --git a/scripts/xdg-utils-common.in b/scripts/xdg-utils-common.in
56ce6d
index 7d2c49c..b4333e2 100644
56ce6d
--- a/scripts/xdg-utils-common.in
56ce6d
+++ b/scripts/xdg-utils-common.in
56ce6d
@@ -288,7 +288,7 @@ detectDE()
56ce6d
          KDE)
56ce6d
            DE=kde;
56ce6d
            ;;
56ce6d
-         Deepin)
56ce6d
+         DEEPIN|Deepin|deepin)
56ce6d
            DE=deepin;
56ce6d
            ;;
56ce6d
          LXDE)
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 186966735dcccd61afde937118f27043bd084f57 Mon Sep 17 00:00:00 2001
56ce6d
From: Richard Tollerton <rich.tollerton@ni.com>
56ce6d
Date: Thu, 10 Jan 2019 15:41:08 -0600
56ce6d
Subject: [PATCH 05/16] xdg-open: handle file://localhost/
56ce6d
56ce6d
Presently, file://localhost/ URLs are totally unsupported: is_file_url_or_path
56ce6d
correctly considers them files, but they are undecoded and hence
56ce6d
check_input_file fails.
56ce6d
56ce6d
While the standardization surrounding file: URLs is admittedly vague [1], AFAIK,
56ce6d
*all* literature, and other implementations, unambiguously demonstrate that
56ce6d
file://localhost/ should be equivalent to file:///:
56ce6d
56ce6d
- The "File URI specification" explicitly linked to from the xdg-utils homepage [2]
56ce6d
- RFC 8089 section 1.1
56ce6d
- RFC 1738 section 3.10
56ce6d
- Observed implementations of Windows `start`, macOS `open`, Firefox, Chrome, IE
56ce6d
56ce6d
Fix this by adding some simple carve-outs for file://localhost specifically in
56ce6d
file_url_to_path.
56ce6d
56ce6d
[1] https://lists.freedesktop.org/archives/xdg/2004-November/003711.html
56ce6d
[2] https://edeproject.org/spec/file-uri-spec.txt
56ce6d
56ce6d
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
56ce6d
---
56ce6d
 autotests/t-xdg-open.sh | 6 ++++++
56ce6d
 scripts/xdg-open.in     | 3 ++-
56ce6d
 2 files changed, 8 insertions(+), 1 deletion(-)
56ce6d
56ce6d
diff --git a/autotests/t-xdg-open.sh b/autotests/t-xdg-open.sh
56ce6d
index 810bdc3..0d4b8d2 100755
56ce6d
--- a/autotests/t-xdg-open.sh
56ce6d
+++ b/autotests/t-xdg-open.sh
56ce6d
@@ -155,3 +155,9 @@ test_generic_open_file 'test#file.txt'
56ce6d
 
56ce6d
 test_that_it opens files with spaces in their name in generic mode
56ce6d
 test_generic_open_file 'test file.txt'
56ce6d
+
56ce6d
+test_that_it opens file://localhost/ paths
56ce6d
+mock pcmanfm
56ce6d
+touch $LABDIR/file.txt
56ce6d
+run lxde xdg-open file://localhost$(pwd)/$LABDIR/file%2etxt
56ce6d
+assert_run pcmanfm $(pwd)/$LABDIR/file.txt
56ce6d
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
56ce6d
index 4928538..09ef6d8 100644
56ce6d
--- a/scripts/xdg-open.in
56ce6d
+++ b/scripts/xdg-open.in
56ce6d
@@ -84,7 +84,8 @@ is_file_url_or_path()
56ce6d
 file_url_to_path()
56ce6d
 {
56ce6d
     local file="$1"
56ce6d
-    if echo "$file" | grep -q '^file:///'; then
56ce6d
+    if echo "$file" | grep -q '^file://\(localhost\)\?/'; then
56ce6d
+        file=${file#file://localhost}
56ce6d
         file=${file#file://}
56ce6d
         file=${file%%#*}
56ce6d
         file=$(echo "$file" | sed -r 's/\?.*$//')
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From af7b34a6d3b77b7c9565fa7b396c7da676aa2fec Mon Sep 17 00:00:00 2001
56ce6d
From: Richard Tollerton <rich.tollerton@ni.com>
56ce6d
Date: Thu, 10 Jan 2019 16:31:38 -0600
56ce6d
Subject: [PATCH 06/16] test-lib.sh: run: eat xdg-open's exit code
56ce6d
56ce6d
It was observed that t-xdg-open.sh exits after only a fraction of the tests have
56ce6d
been run, e.g.
56ce6d
56ce6d
ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/
56ce6d
ASSERTION FAILED: expected command to be run: gio open http://www.freedesktop.org/
56ce6d
  - opens a URL with gvfs-open if gio open is missing in GNOME 3, GNOME 2, and Cinnamon
56ce6d
gio: http://www.freedesktop.org/: Operation not supported
56ce6d
make: *** [Makefile:21: t-xdg-open.sh] Error 4
56ce6d
56ce6d
Given that some tests are failing on my machine (likely because of the
56ce6d
peculiarities of my archlinux install), the root cause is `set -e`. The nonzero
56ce6d
exit code returned by xdg-open gets returned by run(), which is also returned by
56ce6d
e.g. test_open_url(), which causes the script to exit immediately.
56ce6d
56ce6d
All test passes/failures at present are being defined by explicit assertions,
56ce6d
not by exit codes, and it seems at least plausible that some xdg-open calls are
56ce6d
meant to fail. So rather than report the nonzero error code, just ignore it, and
56ce6d
trust that the assertions determine the results.
56ce6d
56ce6d
Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
56ce6d
---
56ce6d
 autotests/test-lib.sh | 2 +-
56ce6d
 1 file changed, 1 insertion(+), 1 deletion(-)
56ce6d
56ce6d
diff --git a/autotests/test-lib.sh b/autotests/test-lib.sh
56ce6d
index 5ea01b3..ca3b10b 100644
56ce6d
--- a/autotests/test-lib.sh
56ce6d
+++ b/autotests/test-lib.sh
56ce6d
@@ -213,7 +213,7 @@ run() {
56ce6d
         XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS \
56ce6d
         DISPLAY=x \
56ce6d
         BROWSER="$BROWSER" \
56ce6d
-        $trace ../scripts/$cmd "$@"
56ce6d
+        $trace ../scripts/$cmd "$@" ||:
56ce6d
 }
56ce6d
 
56ce6d
 echo "* Testing that $COMMAND_TESTED"
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 755e1f27c58016507053d192351666862905b3cc Mon Sep 17 00:00:00 2001
56ce6d
From: Ronan Arraes Jardim Chagas <ronisbr@gmail.com>
56ce6d
Date: Tue, 19 Mar 2019 15:12:58 +1030
56ce6d
Subject: [PATCH 07/16] Fix a bug when xdg-terminal needs gsettings to get the
56ce6d
 default terminal
56ce6d
56ce6d
xdg-terminal is not working when it needs gsettings to obtain the
56ce6d
default terminal. Thus, xdg-terminal cannot be used in MATE, Cinnamon
56ce6d
or GNOME. This issue was already reported in:
56ce6d
https://bugs.freedesktop.org/show_bug.cgi?id=93231
56ce6d
56ce6d
Thus, this patch provides a temporary workaround until upstream fixes
56ce6d
it.
56ce6d
56ce6d
Link: https://bugs.freedesktop.org/show_bug.cgi?id=93231
56ce6d
Signed-off-by: Simon Lees <sflees@suse.de>
56ce6d
---
56ce6d
 scripts/xdg-terminal.in | 4 ++--
56ce6d
 1 file changed, 2 insertions(+), 2 deletions(-)
56ce6d
56ce6d
diff --git a/scripts/xdg-terminal.in b/scripts/xdg-terminal.in
56ce6d
index f67897d..221487c 100644
56ce6d
--- a/scripts/xdg-terminal.in
56ce6d
+++ b/scripts/xdg-terminal.in
56ce6d
@@ -86,8 +86,8 @@ terminal_gsettings()
56ce6d
 {
56ce6d
     term_schema="$1"; shift
56ce6d
 
56ce6d
-    term_exec=`gsettings get ${term_schema} exec`
56ce6d
-    term_exec_arg=`gsettings get ${term_schema} exec-arg`
56ce6d
+    term_exec=`gsettings get ${term_schema} exec | sed -r "s/^'(.*)'$/\1/"`
56ce6d
+    term_exec_arg=`gsettings get ${term_schema} exec-arg | sed -r "s/^'(.*)'$/\1/"`
56ce6d
 
56ce6d
     terminal_exec=`which $term_exec 2>/dev/null`
56ce6d
 
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From acdf8909f2bf65ca20e69ab1e6bc6854d54b333d Mon Sep 17 00:00:00 2001
56ce6d
From: "sor.alexei@meowr.ru" <sor.alexei@meowr.ru>
56ce6d
Date: Tue, 19 Mar 2019 15:13:38 +1030
56ce6d
Subject: [PATCH 08/16] Fixes -x argument, which is the default for
56ce6d
 {gnome,mate}-terminal
56ce6d
56ce6d
Signed-off-by: Simon Lees <sflees@suse.de>
56ce6d
---
56ce6d
 scripts/xdg-terminal.in | 34 +++++++++++++++++++++++-----------
56ce6d
 1 file changed, 23 insertions(+), 11 deletions(-)
56ce6d
56ce6d
diff --git a/scripts/xdg-terminal.in b/scripts/xdg-terminal.in
56ce6d
index 221487c..36a9833 100644
56ce6d
--- a/scripts/xdg-terminal.in
56ce6d
+++ b/scripts/xdg-terminal.in
56ce6d
@@ -65,11 +65,17 @@ terminal_gnome()
56ce6d
         if [ x"$1" = x"" ]; then
56ce6d
             $terminal_exec
56ce6d
         else
56ce6d
-            if [ x"$term_exec_arg" = x"" ]; then
56ce6d
-                $terminal_exec "$1"
56ce6d
-            else
56ce6d
-                $terminal_exec "$term_exec_arg" "$1"
56ce6d
-            fi
56ce6d
+            case "$term_exec_arg" in
56ce6d
+              "")
56ce6d
+                "$terminal_exec" "$1"
56ce6d
+                ;;
56ce6d
+              *-x*)
56ce6d
+                "$terminal_exec" "$term_exec_arg" sh -c "$1"
56ce6d
+                ;;
56ce6d
+              *)
56ce6d
+                "$terminal_exec" "$term_exec_arg" "$1"
56ce6d
+              ;;
56ce6d
+            esac
56ce6d
         fi
56ce6d
 
56ce6d
         if [ $? -eq 0 ]; then
56ce6d
@@ -93,13 +99,19 @@ terminal_gsettings()
56ce6d
 
56ce6d
     if [ -x "$terminal_exec" ]; then
56ce6d
         if [ x"$1" = x"" ]; then
56ce6d
-            $terminal_exec
56ce6d
+            "$terminal_exec"
56ce6d
         else
56ce6d
-            if [ x"$term_exec_arg" = x"" ]; then
56ce6d
-                $terminal_exec "$1"
56ce6d
-            else
56ce6d
-                $terminal_exec "$term_exec_arg" "$1"
56ce6d
-            fi
56ce6d
+            case "$term_exec_arg" in
56ce6d
+              "")
56ce6d
+                "$terminal_exec" "$1"
56ce6d
+                ;;
56ce6d
+              *-x*)
56ce6d
+                "$terminal_exec" "$term_exec_arg" sh -c "$1"
56ce6d
+                ;;
56ce6d
+              *)
56ce6d
+                "$terminal_exec" "$term_exec_arg" "$1"
56ce6d
+              ;;
56ce6d
+            esac
56ce6d
         fi
56ce6d
 
56ce6d
         if [ $? -eq 0 ]; then
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 455d066182546b37984e6b9719bde2347bf6fa94 Mon Sep 17 00:00:00 2001
56ce6d
From: Iain Lane <iain.lane@canonical.com>
56ce6d
Date: Tue, 2 Oct 2018 10:29:03 +0100
56ce6d
Subject: [PATCH 09/16] xdg-screensaver: Sanitise window name before sending it
56ce6d
 over the bus
56ce6d
56ce6d
libdbus expects string arguments to be valid UTF-8. If they are not,
56ce6d
then it aborts, which causes our backgrounded command to terminate
56ce6d
abnormally.
56ce6d
56ce6d
Signed-off-by: Simon Lees <sflees@suse.de>
56ce6d
---
56ce6d
 scripts/xdg-screensaver.in | 5 +++++
56ce6d
 1 file changed, 5 insertions(+)
56ce6d
56ce6d
diff --git a/scripts/xdg-screensaver.in b/scripts/xdg-screensaver.in
56ce6d
index 9e68196..ccb4307 100644
56ce6d
--- a/scripts/xdg-screensaver.in
56ce6d
+++ b/scripts/xdg-screensaver.in
56ce6d
@@ -468,6 +468,7 @@ screensaver_gnome_screensaver()
56ce6d
         perl -e '
56ce6d
 use strict;
56ce6d
 use warnings;
56ce6d
+use Encode qw(decode);
56ce6d
 use IO::File;
56ce6d
 use Net::DBus;
56ce6d
 use X11::Protocol;
56ce6d
@@ -489,6 +490,10 @@ while (1) {
56ce6d
   }
56ce6d
 }
56ce6d
 
56ce6d
+# Replace any invalid unicode characters with U+FFFD, so we dont crash when we
56ce6d
+# pass them over to D-Bus
56ce6d
+$window_name = decode("utf8", $window_name, Encode::FB_DEFAULT);
56ce6d
+
56ce6d
 # Inhibit idle detection (flags = 8) with window name and ID.
56ce6d
 # We have no reason so just send the window name again.
56ce6d
 my $bus = Net::DBus->session();
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 0801b7104c46ac2eff07bf8b867f7d45c74963c2 Mon Sep 17 00:00:00 2001
56ce6d
From: Reuben Thomas <rrt@sc3d.org>
56ce6d
Date: Sun, 30 Oct 2016 06:21:53 +0000
56ce6d
Subject: [PATCH 10/16] xdg-su: fix some easy TODOs
56ce6d
56ce6d
Although xdg-su is not currently shipped, fix some trivial documentation
56ce6d
TODOs.
56ce6d
56ce6d
Signed-off-by: Simon Lees <sflees@suse.de>
56ce6d
---
56ce6d
 TODO                    |  3 ---
56ce6d
 scripts/desc/xdg-su.xml | 11 ++++++++++-
56ce6d
 2 files changed, 10 insertions(+), 4 deletions(-)
56ce6d
56ce6d
diff --git a/TODO b/TODO
56ce6d
index 183ea6c..a4f3b17 100644
56ce6d
--- a/TODO
56ce6d
+++ b/TODO
56ce6d
@@ -16,9 +16,6 @@ General
56ce6d
 * Add xdg-autostart
56ce6d
 
56ce6d
 xdg-su:
56ce6d
-* The summary is incorrect, it suggests that it can only run things as
56ce6d
-root which is incorrect according to the main body of the document.
56ce6d
-* The -c option is listed in the synopsis, but not in options.
56ce6d
 * It would be useful if it was possible to distinguish between a failure
56ce6d
 because of a bad password or some other failure.
56ce6d
 * use sudo style syntax, drop -c option
56ce6d
diff --git a/scripts/desc/xdg-su.xml b/scripts/desc/xdg-su.xml
56ce6d
index 53a0f32..b4e1b7e 100644
56ce6d
--- a/scripts/desc/xdg-su.xml
56ce6d
+++ b/scripts/desc/xdg-su.xml
56ce6d
@@ -30,7 +30,7 @@
56ce6d
 
56ce6d
   <refnamediv>
56ce6d
     <refname>xdg-su</refname>
56ce6d
-    <refpurpose>run a GUI program as root after prompting for the root password</refpurpose>
56ce6d
+    <refpurpose>run a GUI program as another user (typically root) after prompting for that user's password</refpurpose>
56ce6d
   </refnamediv>
56ce6d
 
56ce6d
   <refsynopsisdiv>
56ce6d
@@ -67,6 +67,15 @@
56ce6d
   <refsect1 id="options">
56ce6d
     <title>Options</title>
56ce6d
     <variablelist>
56ce6d
+      <varlistentry>
56ce6d
+	<term><option>-c <replaceable>command</replaceable></option></term>
56ce6d
+	<listitem>
56ce6d
+	  <simpara>
56ce6d
+	    the command to run. This argument is mandatory.
56ce6d
+	  </simpara>
56ce6d
+	</listitem>
56ce6d
+      </varlistentry>
56ce6d
+
56ce6d
       <varlistentry>
56ce6d
 	<term><option>-u <replaceable>user</replaceable></option></term>
56ce6d
 	<listitem>
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 15144f8abd0bfd7de23b18a282f539d1e9c79ef9 Mon Sep 17 00:00:00 2001
56ce6d
From: Reuben Thomas <rrt@sc3d.org>
56ce6d
Date: Sun, 30 Oct 2016 06:12:45 +0000
56ce6d
Subject: [PATCH 11/16] xdg-open: fix comment typo
56ce6d
MIME-Version: 1.0
56ce6d
Content-Type: text/plain; charset=UTF-8
56ce6d
Content-Transfer-Encoding: 8bit
56ce6d
56ce6d
Also bump Rex Dieter’s copyright date
56ce6d
56ce6d
Signed-off-by: Simon Lees <sflees@suse.de>
56ce6d
---
56ce6d
 scripts/xdg-open.in | 4 ++--
56ce6d
 1 file changed, 2 insertions(+), 2 deletions(-)
56ce6d
56ce6d
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
56ce6d
index 09ef6d8..c38e1e0 100644
56ce6d
--- a/scripts/xdg-open.in
56ce6d
+++ b/scripts/xdg-open.in
56ce6d
@@ -7,7 +7,7 @@
56ce6d
 #   Refer to the usage() function below for usage.
56ce6d
 #
56ce6d
 #   Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
56ce6d
-#   Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
56ce6d
+#   Copyright 2009-2016, Rex Dieter <rdieter@fedoraproject.org>
56ce6d
 #   Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
56ce6d
 #   Copyright 2006, Jeremy White <jwhite@codeweavers.com>
56ce6d
 #
56ce6d
@@ -510,7 +510,7 @@ fi
56ce6d
 
56ce6d
 DEBUG 2 "Selected DE $DE"
56ce6d
 
56ce6d
-# sanitize BROWSER (avoid caling ourselves in particular)
56ce6d
+# sanitize BROWSER (avoid calling ourselves in particular)
56ce6d
 case "${BROWSER}" in
56ce6d
     *:"xdg-open"|"xdg-open":*)
56ce6d
         BROWSER=$(echo $BROWSER | sed -e 's|:xdg-open||g' -e 's|xdg-open:||g')
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 7f5349ea485fa9e0a4cb69dc645fbaf9ce3cec2e Mon Sep 17 00:00:00 2001
56ce6d
From: mvdlinde <linde@b1-systems.de>
56ce6d
Date: Sun, 3 Mar 2019 16:20:48 +0000
56ce6d
Subject: [PATCH 12/16] Enable cinnamon screensaver for xdg aware desktop
56ce6d
 environments (eg lxqt)
56ce6d
56ce6d
---
56ce6d
 scripts/xdg-screensaver.in | 2 ++
56ce6d
 1 file changed, 2 insertions(+)
56ce6d
56ce6d
diff --git a/scripts/xdg-screensaver.in b/scripts/xdg-screensaver.in
56ce6d
index 9e68196..bc5c4ee 100644
56ce6d
--- a/scripts/xdg-screensaver.in
56ce6d
+++ b/scripts/xdg-screensaver.in
56ce6d
@@ -887,6 +887,8 @@ xscreensaver-command -version 2> /dev/null | grep XScreenSaver > /dev/null && DE
56ce6d
 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"
56ce6d
 # Consider "mate-screensaver" a separate DE
56ce6d
 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"
56ce6d
+# Consider "cinnamon-screensaver" a separate DE
56ce6d
+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"
56ce6d
 # Consider "xautolock" a separate DE
56ce6d
 xautolock -enable > /dev/null 2>&1 && DE="xautolock_screensaver"
56ce6d
 
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From bfcefa162b1dcd6d62e193019969ff2f5ff331cf Mon Sep 17 00:00:00 2001
56ce6d
From: Cameron Fieber <cameron@fieber.ca>
56ce6d
Date: Mon, 25 Mar 2019 22:30:25 -0700
56ce6d
Subject: [PATCH 13/16] support digits in uri scheme regex
56ce6d
56ce6d
As per RFC 2396[1] a valid URI scheme may contain a digit:
56ce6d
56ce6d
scheme        = alpha *( alpha | digit | + | - | . )
56ce6d
56ce6d
[1]: https://www.ietf.org/rfc/rfc2396.txt
56ce6d
---
56ce6d
 scripts/xdg-open.in | 2 +-
56ce6d
 1 file changed, 1 insertion(+), 1 deletion(-)
56ce6d
56ce6d
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
56ce6d
index c38e1e0..202f3e3 100644
56ce6d
--- a/scripts/xdg-open.in
56ce6d
+++ b/scripts/xdg-open.in
56ce6d
@@ -72,7 +72,7 @@ get_key()
56ce6d
 is_file_url_or_path()
56ce6d
 {
56ce6d
     if echo "$1" | grep -q '^file://' \
56ce6d
-            || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then
56ce6d
+            || ! echo "$1" | egrep -q '^[[:alpha:]][[:alpha:][:digit:]+\.\-]*:'; then
56ce6d
         return 0
56ce6d
     else
56ce6d
         return 1
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 0547886c0a7ae79145998495a6e3af6a1450d0c7 Mon Sep 17 00:00:00 2001
56ce6d
From: Martin Puppe <dev@mpuppe.de>
56ce6d
Date: Sat, 13 Apr 2019 12:46:44 +0200
56ce6d
Subject: [PATCH 14/16] xdg-mime: return correct exit code for GNOME
56ce6d
56ce6d
If the desktop environment was GNOME and none of the commands for
56ce6d
detecting the MIME type of a file was available, xdg-mime used to return
56ce6d
exit code 0 even though it failed. The man page says it should return
56ce6d
exit code 3. This commit fixes the issue.
56ce6d
56ce6d
I have considered returning exit code 4 instead since that is what would
56ce6d
be returned if info_kde() or info_generic() fail to find a tool for MIME
56ce6d
type detection. But I have decided to implement the behavior as
56ce6d
specified in the man page.
56ce6d
56ce6d
The exit code of an if construct is 0 if no condition
56ce6d
tested true [^1]. The author of the original code probably was not aware
56ce6d
of this.
56ce6d
56ce6d
[^1]: https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#Conditional-Constructs
56ce6d
---
56ce6d
 scripts/xdg-mime.in | 2 ++
56ce6d
 1 file changed, 2 insertions(+)
56ce6d
56ce6d
diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in
56ce6d
index 0e567c7..034d0ef 100644
56ce6d
--- a/scripts/xdg-mime.in
56ce6d
+++ b/scripts/xdg-mime.in
56ce6d
@@ -84,6 +84,8 @@ info_gnome()
56ce6d
     elif gnomevfs-info --help 2>/dev/null 1>&2; then
56ce6d
         DEBUG 1 "Running gnomevfs-info \"$1\""
56ce6d
         gnomevfs-info --slow-mime "$1" 2> /dev/null | grep "^MIME" | cut -d ":" -f 2 | sed s/"^ "//
56ce6d
+    else
56ce6d
+        exit_failure_operation_impossible "no method available for querying MIME type of '$filename'"
56ce6d
     fi
56ce6d
 
56ce6d
     if [ $? -eq 0 ]; then
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From 9816ebb3e6fd9f23e993b8b7fcbd56f92d9c9197 Mon Sep 17 00:00:00 2001
56ce6d
From: Andrea Tarocchi <andrea.tarocchi@gmail.com>
56ce6d
Date: Thu, 20 Feb 2020 22:01:04 +0100
56ce6d
Subject: [PATCH 15/16] fixed #166: xdg-open dose not search correctly in
56ce6d
 directories with spaces in the name
56ce6d
56ce6d
---
56ce6d
 scripts/xdg-mime.in | 2 +-
56ce6d
 scripts/xdg-open.in | 2 +-
56ce6d
 2 files changed, 2 insertions(+), 2 deletions(-)
56ce6d
56ce6d
diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in
56ce6d
index 034d0ef..612d2ce 100644
56ce6d
--- a/scripts/xdg-mime.in
56ce6d
+++ b/scripts/xdg-mime.in
56ce6d
@@ -307,7 +307,7 @@ search_desktop_file()
56ce6d
 
56ce6d
     grep -l "$MIME;" "$dir/"*.desktop 2>/dev/null
56ce6d
 
56ce6d
-    for f in $dir/*/; do
56ce6d
+    for f in "$dir/"*/; do
56ce6d
       [ -d "$f" ] && search_desktop_file "$MIME" "$f"
56ce6d
     done
56ce6d
 }
56ce6d
diff --git a/scripts/xdg-open.in b/scripts/xdg-open.in
56ce6d
index 202f3e3..8de839a 100644
56ce6d
--- a/scripts/xdg-open.in
56ce6d
+++ b/scripts/xdg-open.in
56ce6d
@@ -328,7 +328,7 @@ search_desktop_file()
56ce6d
         fi
56ce6d
     fi
56ce6d
 
56ce6d
-    for d in $dir/*/; do
56ce6d
+    for d in "$dir/"*/; do
56ce6d
         [ -d "$d" ] && search_desktop_file "$default" "$d" "$target"
56ce6d
     done
56ce6d
 }
56ce6d
-- 
56ce6d
2.33.1
56ce6d
56ce6d
56ce6d
From d11b33ec7f24cfb1546f6b459611d440013bdc72 Mon Sep 17 00:00:00 2001
56ce6d
From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven.car@enioka.com>
56ce6d
Date: Wed, 21 Oct 2020 16:58:20 +0200
56ce6d
Subject: [PATCH 16/16] Fix xdg-settings support for default-web-browser for
56ce6d
 Plasma 5.19+
56ce6d
56ce6d
---
56ce6d
 scripts/xdg-settings.in | 18 +++++++++++++++---
56ce6d
 1 file changed, 15 insertions(+), 3 deletions(-)
56ce6d
 mode change 100644 => 100755 scripts/xdg-settings.in
56ce6d
56ce6d
diff --git a/scripts/xdg-settings.in b/scripts/xdg-settings.in
56ce6d
old mode 100644
56ce6d
new mode 100755
56ce6d
index 3781de8..ab18d3a
56ce6d
--- a/scripts/xdg-settings.in
56ce6d
+++ b/scripts/xdg-settings.in
56ce6d
@@ -130,7 +130,7 @@ set_browser_mime()
56ce6d
     fix_local_desktop_file "$1" "$MIME" || return
56ce6d
     mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/applications"
56ce6d
     xdg-mime default "$1" "$MIME" || return
56ce6d
-    if [ x"`get_browser_mime`" != x"$1" ]; then
56ce6d
+    if [ x"`get_browser_mime $MIME`" != x"$1" ]; then
56ce6d
         # Put back the original value
56ce6d
         xdg-mime default "$orig" "$MIME"
56ce6d
         exit_failure_operation_failed
56ce6d
@@ -203,7 +203,13 @@ resolve_kde_browser_desktop()
56ce6d
 
56ce6d
 read_kde_browser()
56ce6d
 {
56ce6d
-    read_kde_config kdeglobals General BrowserApplication
56ce6d
+    ret=`read_kde_config kdeglobals General BrowserApplication`
56ce6d
+    if [ -z "$ret" ]; then
56ce6d
+        # since Plasma >= 5.19
56ce6d
+        ret=`get_browser_mime "x-scheme-handler/http"`
56ce6d
+    fi
56ce6d
+    
56ce6d
+    echo $ret
56ce6d
 }
56ce6d
 
56ce6d
 get_browser_kde()
56ce6d
@@ -252,7 +258,13 @@ check_browser_kde()
56ce6d
 
56ce6d
 set_browser_kde()
56ce6d
 {
56ce6d
-    set_browser_mime "$1" || return
56ce6d
+    # Set the default browser.
56ce6d
+    for protocol in http https; do
56ce6d
+        set_browser_mime "$1" "x-scheme-handler/$protocol" || return
56ce6d
+    done
56ce6d
+
56ce6d
+    # Plasma < 5.19
56ce6d
+    set_browser_mime "$1" "text/html" || return
56ce6d
     if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then
56ce6d
         kwriteconfig5 --file kdeglobals --group General --key BrowserApplication "$1"
56ce6d
     else
56ce6d
-- 
56ce6d
2.33.1
56ce6d