From 038dd3dbac7fd2e3f4426134b0decb3e46804785c543c5159438d3d40b296d80 Mon Sep 17 00:00:00 2001 From: Simon Lees Date: Fri, 4 May 2018 05:26:49 +0000 Subject: [PATCH] Accepting request 603862 from home:simotek:branches:X11:common:Factory - boo#1051353 can't set default browser on kde. * fix-kde-browser-check.patch OBS-URL: https://build.opensuse.org/request/show/603862 OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/xdg-utils?expand=0&rev=61 --- fix-kde-browser-check.patch | 49 +++++++++++++++++++++++++++++++++++++ xdg-utils.changes | 5 ++++ xdg-utils.spec | 5 ++-- 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 fix-kde-browser-check.patch diff --git a/fix-kde-browser-check.patch b/fix-kde-browser-check.patch new file mode 100644 index 0000000..72a56fb --- /dev/null +++ b/fix-kde-browser-check.patch @@ -0,0 +1,49 @@ +Index: xdg-utils-20160610/scripts/xdg-settings.in +=================================================================== +--- xdg-utils-20160610.orig/scripts/xdg-settings.in ++++ xdg-utils-20160610/scripts/xdg-settings.in +@@ -226,6 +226,14 @@ check_browser_kde() + fi + browser="`read_kde_browser`" + binary="`resolve_kde_browser`" ++ ++ # The browser may contain a relative entry to the binary starting with ! ++ if [ x"!" == x"${browser:0:1}" ]; then ++ # get the full path ++ browser="`binary_to_desktop_file ${browser:1}`" ++ binary="`desktop_file_to_binary $browser`" ++ fi ++ + # Because KDE will use the handler for MIME type text/html if this value + # is empty, we allow either the empty string or a match to $check here. + if [ x"$binary" != x -a x"$binary" != x"$check" ]; then +@@ -575,16 +583,23 @@ check_url_scheme_handler_kde() + fi + if [ x"$1" = "mailto" ]; then + binary="`read_kde_config emaildefaults PROFILE_Default EmailClient`" ++ # The field may contain a relative entry to the binary starting with ! ++ if [ x"!" == x"${binary:0:1}" ]; then ++ # get the full path ++ desktop_file="`binary_to_desktop_file ${binary:1}`" ++ binary="`desktop_file_to_binary $desktop_file`" ++ fi ++ if [ x"$binary" != x"$check" ]; then ++ echo no ++ exit_success ++ fi ++ else ++ handler="`get_browser_mime x-scheme-handler/$1`" ++ binary="`desktop_file_to_binary "$handler"`" + if [ x"$binary" != x"$check" ]; then + echo no + exit_success + fi +- fi +- handler="`get_browser_mime x-scheme-handler/$1`" +- binary="`desktop_file_to_binary "$handler"`" +- if [ x"$binary" != x"$check" ]; then +- echo no +- exit_success + fi + echo yes + exit_success diff --git a/xdg-utils.changes b/xdg-utils.changes index 1423ad9..e0fe71e 100644 --- a/xdg-utils.changes +++ b/xdg-utils.changes @@ -1,3 +1,8 @@ +Tue May 1 05:28:49 UTC 2018 - sflees@suse.de + +- boo#1051353 can't set default browser on kde. + * fix-kde-browser-check.patch + ------------------------------------------------------------------- Tue May 23 09:30:35 UTC 2017 - jslaby@suse.com diff --git a/xdg-utils.spec b/xdg-utils.spec index 8e21cad..e9e1efc 100644 --- a/xdg-utils.spec +++ b/xdg-utils.spec @@ -31,6 +31,7 @@ Patch0: install-some-more-scripts.diff Patch1: xdg-terminal-fix-gsettings.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 +Patch4: fix-kde-browser-check.patch BuildRequires: make # for xmlto to be able to generate text from html BuildRequires: w3m @@ -65,9 +66,7 @@ This means that: %prep %setup -q -%patch0 -p1 -%patch1 -p1 -%patch3 -p1 +%autopatch -p1 %build %configure