diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/.gitignore xdg-utils-1.1.1/autotests/.gitignore --- xdg-utils-1.1.0~rc3+git20150907/autotests/.gitignore 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/.gitignore 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,2 @@ +/lab +/failed-tests diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/Makefile.in xdg-utils-1.1.1/autotests/Makefile.in --- xdg-utils-1.1.0~rc3+git20150907/autotests/Makefile.in 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/Makefile.in 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,34 @@ +T := $(sort $(wildcard t-*.sh)) + +all: + +test: $(T) + @if [ -e failed-tests ]; then \ + echo; \ + echo TEST FAILURES:; \ + echo; \ + cat failed-tests; \ + echo; \ + exit 1; \ + fi + +autotest: test + +remove-failed-tests: + rm -f failed-tests + +$(T): remove-failed-tests + @sh $@ + +clean: remove-failed-tests + rm -fr lab + +distclean: clean + rm -f Makefile + +install: +uninstall: +release: + +.PHONY: test autotest remove-failed-tests all install uninstall release \ + distclean $(T) diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/mock-kreadconfig5 xdg-utils-1.1.1/autotests/mock-kreadconfig5 --- xdg-utils-1.1.0~rc3+git20150907/autotests/mock-kreadconfig5 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/mock-kreadconfig5 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,36 @@ +#!/bin/sh +set -e + +abort() { + echo "mock-kreadconfig5: $*" >&2 + exit 1 +} + +group= +key= +while [ -n "$1" ]; do + case "$1" in + --file) + [ "$2" = emaildefaults ] || + abort "expected: --file emaildefaults, got: --file $2" + ;; + --group) + group="$2" + ;; + --key) + key="$2" + ;; + *) + abort "unknown argument: $1" + ;; + esac + shift 2 +done + +if [ "$group" = Defaults ] && [ "$key" = Profile ]; then + echo DefProf +elif [ "$group" = PROFILE_DefProf ] && [ "$key" = EmailClient ]; then + echo "thunderbird %u" +else + abort "unknown group $group with key $key" +fi diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/test-lib.sh xdg-utils-1.1.1/autotests/test-lib.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/test-lib.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/test-lib.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,219 @@ +set -e + +TEST_NAME=$0 +LABDIR=lab +LABHOME=lab/home +BINDIR=$LABDIR/bin +COMMANDS_RUN=$LABDIR/commands-run +FAILED_TESTS=failed-tests +CURRENT_TEST_CASE= +XDG_DATA_HOME=$LABHOME/.local/share +XDG_DATA_DIR=$LABDIR/share +XDG_DATA_DIR_LOCAL=$LABDIR/share-local +XDG_DATA_DIRS=$XDG_DATA_DIR_LOCAL:$XDG_DATA_DIR +XDG_CONFIG_HOME=$LABHOME/.config +XDG_CONFIG_DIRS=$LABDIR/etc-xdg + +fatal() { + echo "FATAL: $*" >&2 + exit 1 +} + +reset_lab_() { + [ -f test-lib.sh ] || fatal "You must run tests from the autotests directory!" + [ -e $LABDIR ] && rm -r $LABDIR + + BROWSER= + + mkdir -p \ + $BINDIR \ + $LABHOME \ + $XDG_DATA_HOME/applications $XDG_DATA_DIR/applications \ + $XDG_DATA_DIR_LOCAL/applications \ + $XDG_DATA_HOME/icons/hicolor $XDG_DATA_DIR/icons/hicolor \ + $XDG_DATA_DIR_LOCAL/icons/hicolor \ + $XDG_CONFIG_HOME \ + $XDG_CONFIG_DIRS \ + + mock x-www-browser + touch $COMMANDS_RUN +} + +test_that_it() { + CURRENT_TEST_CASE="$*" + echo " - $CURRENT_TEST_CASE" + reset_lab_ +} + +set_de_() { + unmock gnome-default-applications-properties + unmock kde-config + KDE_SESSION_VERSION= + + case "$1" in + cinnamon) + XDG_CURRENT_DESKTOP=Cinnamon + ;; + enlightenment) + XDG_CURRENT_DESKTOP=ENLIGHTENMENT + ;; + gnome2) + XDG_CURRENT_DESKTOP=GNOME + mock gnome-default-applications-properties + ;; + gnome3) + XDG_CURRENT_DESKTOP=GNOME + ;; + kde3) + XDG_CURRENT_DESKTOP=KDE + mock_output kde-config "KDE: 3.5.5" + ;; + kde4) + XDG_CURRENT_DESKTOP=KDE + KDE_SESSION_VERSION=4 + ;; + kde5) + XDG_CURRENT_DESKTOP=KDE + KDE_SESSION_VERSION=5 + ;; + lxde) + XDG_CURRENT_DESKTOP=LXDE + ;; + mate) + XDG_CURRENT_DESKTOP=MATE + ;; + xfce) + XDG_CURRENT_DESKTOP=XFCE + ;; + generic) + XDG_CURRENT_DESKTOP=X-Generic + ;; + *) + fatal "unknown desktop environment: $1" + ;; + esac +} + +mock() { + local command="$1" script="$2" + local executable="$BINDIR/$command" + + cat >"$executable" <> $(pwd)/$COMMANDS_RUN +$script +EOF + chmod +x "$executable" +} + +mock_missing() { + local command="$1" + mock "$command" "exit 127" +} + +mock_output() { + local command="$1" output="$2" + mock "$command" "echo '$output'" +} + +unmock() { + if [ -e "$BINDIR/$1" ]; then + rm "$BINDIR/$1" + fi +} + +is_mocked() { + if [ -e "$BINDIR/$1" ]; then + return 0 + else + return 1 + fi +} + +mock_desktop_file() { + cat > "$XDG_DATA_DIR/applications/$1.desktop" < $mimeapps + fi + echo "$mimetype=$app.desktop" >> $mimeapps +} + +assertion_failed() { + echo "ASSERTION FAILED: $*" >&2 + echo "$TEST_NAME: Assertion failed when testing that $COMMAND_TESTED" \ + "$CURRENT_TEST_CASE: $*" >> $FAILED_TESTS +} + +assert_run() { + if grep -Fxq "$*" $COMMANDS_RUN; then + return 0 + else + assertion_failed "expected command to be run: $*" + fi +} + +assert_equal() { + if [ "$1" = "$2" ]; then + return 0 + else + assertion_failed "expected: '$1' got: '$2'" + fi +} + +assert_file_exists() { + if [ -e "$1" ]; then + return 0 + else + assertion_failed "expected file to exist: $1" + fi +} + +run() { + local de="$1" + shift + + local cmd="$1" + shift + + : > $COMMANDS_RUN + + set_de_ $de + + local trace= + if [ "$TRACE" = 1 ]; then + trace="sh -x" + fi + + if [ "$TRACE" = 1 ] || [ "$TRACE_RUN" = 1 ]; then + echo "RUN [$de] $cmd $*" >&2 + fi + + env -i \ + PATH="$BINDIR:../scripts:$PATH" \ + SHELL="$SHELL" \ + USERNAME="$USERNAME" \ + HOME="$LABHOME" \ + LOGNAME="$LOGNAME" \ + TERM="$TERM" \ + XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP" \ + XDG_UTILS_DEBUG_LEVEL="$XDG_UTILS_DEBUG_LEVEL" \ + KDE_SESSION_VERSION="$KDE_SESSION_VERSION" \ + XDG_DATA_DIRS=$XDG_DATA_DIRS \ + XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS \ + DISPLAY=x \ + BROWSER="$BROWSER" \ + $trace ../scripts/$cmd "$@" +} + +echo "* Testing that $COMMAND_TESTED" diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-email.sh xdg-utils-1.1.1/autotests/t-xdg-email.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-email.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/t-xdg-email.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,34 @@ +#!/bin/sh +COMMAND_TESTED=xdg-email +. ./test-lib.sh + +test_that_it uses kmailservice to launch the default e-mail client in KDE3 +mock kreadconfig +mock kmailservice +run kde3 xdg-email test@example.org +assert_run kmailservice mailto:test@example.org + +test_that_it uses kde-open to launch the default e-mail client in KDE4 +mock kreadconfig +mock kde-open +mock kmailservice +mock_output kde4-config kmailservice +run kde4 xdg-email test@example.org +assert_run kde-open mailto:test@example.org + +test_that_it uses kde-open5 to launch the default e-mail client in KDE5 +mock kreadconfig +mock kde-open5 +mock kmailservice +mock kmailservice5 +run kde5 xdg-email test@example.org +assert_run kde-open5 mailto:test@example.org + +test_that_it uses run_thunderbird if default e-mail client is Thunderbird \ + in KDE5 +cp mock-kreadconfig5 $BINDIR/kreadconfig5 +mock thunderbird +mock kmailservice +mock kmailservice5 +run kde5 xdg-email test@example.org +assert_run thunderbird -compose to=\'test@example.org,\' diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-icon-resource.sh xdg-utils-1.1.1/autotests/t-xdg-icon-resource.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-icon-resource.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/t-xdg-icon-resource.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,9 @@ +#!/bin/sh +COMMAND_TESTED=xdg-icon-resource +. ./test-lib.sh + +test_that_it installs a png icon system-wide +touch $LABDIR/icon.png +run generic xdg-icon-resource install --mode system --size 256 \ + $LABDIR/icon.png myvendor-myapp +assert_file_exists $XDG_DATA_DIR_LOCAL/icons/hicolor/256x256/apps/myvendor-myapp.png diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-mime-query-default.sh xdg-utils-1.1.1/autotests/t-xdg-mime-query-default.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-mime-query-default.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/t-xdg-mime-query-default.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,8 @@ +#!/bin/sh +COMMAND_TESTED="xdg-mime query default" +. ./test-lib.sh + +test_that_it reads \$XDG_CONFIG_HOME/mimeapps.list +mock_default_app x-scheme-handler/http mosaic +handler=$(run generic xdg-mime query default x-scheme-handler/http) +assert_equal mosaic.desktop "$handler" diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-open.sh xdg-utils-1.1.1/autotests/t-xdg-open.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-open.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/t-xdg-open.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,143 @@ +#!/bin/sh +COMMAND_TESTED=xdg-open +. ./test-lib.sh + +test_open_url() { + local de=$1 + shift + local cmd=$1 + + mock $cmd + run $de xdg-open http://www.freedesktop.org/ + assert_run "$@" http://www.freedesktop.org/ + unmock $cmd +} + +mock_xdg_mime() { + local file="$1" mimetype="$2" handler="$3" + mock xdg-mime ' +if [ $# = 3 ] && [ "$1" = query ] && [ "$2" = filetype ] && \ + [ "$3" = '\'"$file"\'' ]; then + echo '$mimetype' +elif [ $# = 3 ] && [ "$1" = query ] && [ "$2" = default ] && \ + [ "$3" = '$mimetype' ]; then + echo '$handler'.desktop +else + echo "unexpected mock invokation: xdg-mime $*" >&2 + exit 1 +fi +' +} + +test_generic_open_file() { + local filename="$1" + echo foo > "$LABDIR/$1" + mock_xdg_mime "$LABDIR/$1" text/plain textedit + mock_desktop_file textedit %f + mock textedit + run generic xdg-open "$LABDIR/$1" + assert_run textedit "$LABDIR/$1" +} + +test_that_it opens a URL with gvfs-open in GNOME 2, 3, and Cinnamon +test_open_url gnome3 gvfs-open +test_open_url gnome2 gvfs-open +test_open_url cinnamon gvfs-open + +test_that_it opens a URL with gnome-open if gvfs-open is missing in GNOME 2 +mock_missing gvfs-open +test_open_url gnome2 gnome-open + +test_that_it opens a URL with the generic method if gvfs-open is missing \ + in GNOME 3 and Cinnamon +mock_missing gvfs-open +mock gnome-open +mock_desktop_file mosaic %u +mock_default_app x-scheme-handler/http mosaic +test_open_url gnome3 mosaic +test_open_url cinnamon mosaic + +test_that_it opens a URL with the generic method if gvfs-open and gnome-open \ + are missing in GNOME 2 +mock_missing gvfs-open +mock_missing gnome-open +mock_desktop_file mosaic %u +mock_default_app x-scheme-handler/http mosaic +test_open_url gnome2 mosaic + +test_that_it opens a URL with kfmclient in KDE 3 +test_open_url kde3 kfmclient exec + +test_that_it opens a URL with kde-open in KDE 4 +test_open_url kde4 kde-open + +test_that_it opens a URL with kde-open5 in KDE 5 +test_open_url kde5 kde-open5 + +test_that_it opens a URL with gvfs-open in MATE +test_open_url mate gvfs-open + +test_that_it opens a URL with mate-open if gvfs-open is missing in MATE +mock_missing gvfs-open +test_open_url mate mate-open + +test_that_it opens a URL with exo-open in XFCE +test_open_url xfce exo-open + +test_that_it opens a URL with enlightenment_open in Enlightenment +test_open_url enlightenment enlightenment_open + +test_that_it opens a file path with pcmanfm in LXDE +mock pcmanfm +touch $LABDIR/file.txt +run lxde xdg-open $LABDIR/file.txt +assert_run pcmanfm $(pwd)/$LABDIR/file.txt + +test_that_it percent-decodes a file:// URL and opens it with pcmanfm in LXDE +mock pcmanfm +touch $LABDIR/file.txt +run lxde xdg-open file://$(pwd)/$LABDIR/file%2etxt +assert_run pcmanfm $(pwd)/$LABDIR/file.txt + +test_that_it opens files with spaces in their name in LXDE +echo foo > "$LABDIR/test file.txt" +mock pcmanfm +run lxde xdg-open "$LABDIR/test file.txt" +assert_run pcmanfm "$(pwd)/$LABDIR/test file.txt" + +test_that_it looks up x-scheme-handler/\* in LXDE +mock_desktop_file mosaic %u +mock_default_app x-scheme-handler/http mosaic +test_open_url lxde mosaic + +test_that_it looks up x-scheme-handler/\* in generic mode +mock_desktop_file mosaic %u +mock_default_app x-scheme-handler/http mosaic +test_open_url generic mosaic + +test_that_it always uses \$BROWSER if set in generic mode +BROWSER=cyberdog +mock_desktop_file mosaic %u +mock_default_app x-scheme-handler/http mosaic +mock mosaic +test_open_url generic cyberdog + +test_that_it works with multi-word \$BROWSER commands +BROWSER="cyberdog --url %s" +test_open_url generic cyberdog --url + +test_that_it is not vulnerable to command injection in URLs when using \ + \$BROWSER in generic mode +mock cyberdog +BROWSER="cyberdog --url %s" +run generic xdg-open 'http://www.freedesktop.org/; echo BUSTED' +assert_run cyberdog --url 'http://www.freedesktop.org/; echo BUSTED' + +test_that_it opens files in generic mode +test_generic_open_file test.txt + +test_that_it opens files with \# characters in their name in generic mode +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' diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-screensaver.sh xdg-utils-1.1.1/autotests/t-xdg-screensaver.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-screensaver.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/t-xdg-screensaver.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,11 @@ +#!/bin/sh +COMMAND_TESTED=xdg-screensaver +. ./test-lib.sh + +test_that_it calls xset -dpms, xset +dpms and xset dpms force when \ + performing reset +mock xset 'if [ "$1" = -q ]; then echo " DPMS is Enabled"; fi' +run generic xdg-screensaver reset +assert_run xset -dpms +assert_run xset +dpms +assert_run xset dpms force on diff -Nru xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-settings.sh xdg-utils-1.1.1/autotests/t-xdg-settings.sh --- xdg-utils-1.1.0~rc3+git20150907/autotests/t-xdg-settings.sh 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/autotests/t-xdg-settings.sh 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1,33 @@ +#!/bin/sh +COMMAND_TESTED=xdg-settings +. ./test-lib.sh + +test_that_it determines default browser using GConf in GNOME 2 +mock_output gconftool-2 "mosaic %s" +mock_desktop_file mosaic %u +assert_equal mosaic.desktop \ + "$(run gnome2 xdg-settings get default-web-browser)" +assert_run gconftool-2 --get /desktop/gnome/applications/browser/exec + +for de in gnome3 cinnamon lxde mate generic; do + test_that_it determines default browser from \ + \$XDG_CONFIG_HOME/mimeapps.list in $de + mock_default_app x-scheme-handler/http mosaic + assert_equal mosaic.desktop \ + "$(run $de xdg-settings get default-web-browser)" + + test_that_it determines default URL handler from \ + \$XDG_CONFIG_HOME/mimeapps.list in $de + mock_default_app x-scheme-handler/magnet footorrent + assert_equal \ + footorrent.desktop \ + "$(run $de xdg-settings get default-url-scheme-handler magnet)" +done + +test_that_it uses \$BROWSER in generic mode +mock mosaic +BROWSER=mosaic +mock_desktop_file mosaic +mock_default_app x-scheme-handler/http cyberdog +assert_equal mosaic.desktop \ + "$(run generic xdg-settings get default-web-browser)" diff -Nru xdg-utils-1.1.0~rc3+git20150907/ChangeLog xdg-utils-1.1.1/ChangeLog --- xdg-utils-1.1.0~rc3+git20150907/ChangeLog 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/ChangeLog 2015-10-05 14:59:19.000000000 -0400 @@ -1,4 +1,81 @@ -=== xdg-utils 1.1.x === +=== xdg-utils 1.1.1 === + +2015-10-05 Per Olofsson + * xdg-screensaver: Run 'xset -dpms' and then 'xset +dpms' to reset + the DPMS timer. Thanks to Stephen Thomas for the idea. + (Debian bug #745340) + * xdg-open: Fix regression in generic mode (wrong variable name) which + prevented files from being opened using the desktop file/mimeapps.list + mechanism. + * xdg-open: Add proper quoting so that files with spaces in their names + can be opened in generic mode and LXDE. (Debian bug #801048) + +=== xdg-utils 1.1.0 === + +2015-10-04 Per Olofsson + * Add references to specifications to the manuals. (Debian bug #800826) + * xdg-email: Remove obsolete references to + http://portland.freedesktop.org/wiki/EmailConfig from the manual. + +2015-10-03 Per Olofsson + * xdg-email: Rewrite open_kde() + * xdg-open: Only strip queries (?) and fragments (#) from file URLs before + decoding them, not from (decoded) paths. Otherwise we can't open files + with hash or question marks in their names. (Debian bug #800355) + +2015-09-27 Per Olofsson + * xdg-settings: Detect generic DE instead of failing. (Debian bug #787791) + * xdg-settings: Add a proper generic mode. + +2015-09-26 Per Olofsson + * xdg-mime: Check ~/.config/mimeapps.list instead of + ~/.config/applications/mimeapps.list when looking for default + application. + * xdg-open: Fall back to generic mode if gvfs-open and gnome-open + are missing. Don't try to use gnome-open if running under GNOME 3 or + Cinnamon. (Debian bug #685304) + * xdg-open, xdg-email: Add iceweasel to the list of fallback browsers. + (Debian bug #788047) + +2015-09-25 Per Olofsson + * xdg-utils-common: Add support for $XDG_CURRENT_DESKTOP value X-Generic. + When set, xdg-utils will pretend that it is running under a generic DE + which can be useful for debugging purposes. + +2015-09-23 Per Olofsson + * xdg-open: Percent-decode file:// URLs in open_lxde and add testcase. + (BR89654) + +2015-09-22 Per Olofsson + * Add a fully automated (non-interactive) test suite (under development). + Run it using "make autotest". + * xdg-screensaver: Use the DBus API from a Perl script to inhibit + gnome-screensaver. This is necessary since the SimulateUserActivity call + is not implemented. Calling Inhibit using dbus-send does not work either + since gnome-screensaver watches the pid of the calling process and + dbus-send exits immediately. Distributions are advised to make xdg-utils + depend on the Perl modules Net::DBus and X11::Protocol. Thanks to + Ben Hutchings for writing the Perl script. + * xdg-email: Add support for the $MAILER environment variable. + * xdg-open: Add support for running without X. + * xdg-open: Try www-browser first of the non-X browsers. (www-browser is + a symlink to the preferred non-X browser in Debian.) + * xdg-icon-resource: Don't try to install anything into empty $icon_dir's. + +2015-09-20 Per Olofsson + * xdg-open: Try $BROWSER first in generic mode if it is set by the user. + +2015-09-18 Rex Dieter + * xdg-email: Recipients passed to Thunderbird are incorrectly quoted (BR91996) + +2015-09-16 Rex Dieter + * xdg-screensaver support for xautolock (BR89655) + * xdg-icon-resource: does not support filenames with spaces (BR91758) + * xdg-open: Add support for multi-word $BROWSER commands (BR91989) + * xdg-open shell script contains bash code (BR86028) + * xdg-email: bashism: relies on bash's echo in run_thunderbird() (BR91990) + * xdg-email: Icedove support (BR91997) + * xdg-email: generic mode does nothing (BR92008) 2015-07-15 Rex Dieter * better for other (non-gnome) GVfs-based desktops, from Yaakov Selkowitz diff -Nru xdg-utils-1.1.0~rc3+git20150907/configure xdg-utils-1.1.1/configure --- xdg-utils-1.1.0~rc3+git20150907/configure 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/configure 2015-10-05 14:59:19.000000000 -0400 @@ -610,6 +610,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -674,6 +675,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -926,6 +928,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1063,7 +1074,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1216,6 +1227,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1865,7 +1877,7 @@ -ac_config_files="$ac_config_files Makefile scripts/Makefile tests/Makefile" +ac_config_files="$ac_config_files Makefile scripts/Makefile tests/Makefile autotests/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -2576,6 +2588,7 @@ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "autotests/Makefile") CONFIG_FILES="$CONFIG_FILES autotests/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff -Nru xdg-utils-1.1.0~rc3+git20150907/configure.ac xdg-utils-1.1.1/configure.ac --- xdg-utils-1.1.0~rc3+git20150907/configure.ac 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/configure.ac 2015-10-05 14:59:19.000000000 -0400 @@ -9,5 +9,6 @@ Makefile scripts/Makefile tests/Makefile + autotests/Makefile ]) AC_OUTPUT diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/changelog xdg-utils-1.1.1/debian/changelog --- xdg-utils-1.1.0~rc3+git20150907/debian/changelog 2015-11-19 16:57:05.000000000 -0500 +++ xdg-utils-1.1.1/debian/changelog 2016-01-28 09:54:26.000000000 -0500 @@ -1,3 +1,100 @@ +xdg-utils (1.1.1-1ubuntu1) xenial; urgency=low + + * Merge from Debian unstable. Remaining changes: + - debian/patches/xdg-email-mutt-detect.diff + - debian/patches/xdg-screensaver-restore-timeout.diff + - debian/patches/lp779156-lubuntu.diff + Removed patches because upstream implements: + - xdg-email-envvar.diff + - xdg-open-browser-multiword.diff + - xdg-open-printf.diff + - xdg-screensaver-new-gnome.diff + - no-X.diff + - fix-bashism-use-of-echo.patch + - gnome-3.0.diff + - filenames-with-spaces.patch + * debian/patches/mimeappslist-file-location: "xdg-mime default" + only set old deprecated mimeapps location. "xdg-mime query default" + retrieved, but nothing could set. (LP: #1518053) + + -- Chad MILLER Thu, 28 Jan 2016 09:54:20 -0500 + +xdg-utils (1.1.1-1) unstable; urgency=medium + + * New upstream release. + - xdg-open: Handle whitespace in filenames and fix generic mode + regression. Closes: #801048. + - xdg-screensaver: Reset DPMS timer. Closes: #745340. + * Update debian/watch, primary URL is working again. + * Update Description. + + -- Per Olofsson Mon, 05 Oct 2015 21:19:23 +0200 + +xdg-utils (1.1.0-1) unstable; urgency=medium + + * New upstream release. + - Adds references to specifications to the manuals. Closes: #800826. + - xdg-open: Handle files with '?' and '#' in their names in generic mode. + Closes: #800355. + - xdg-settings: Detect generic DE instead of failing. Closes: #787791. + - xdg-open, xdg-email: Add iceweasel to the list of fallback browsers. + Closes: #788047. + - xdg-open: Fall back to generic mode if gvfs-open and gnome-open are + missing. Closes: #685304. + - xdg-mime: Check ~/.config/mimeapps.list for default application. + Closes: #800825. + * Don't build html documentation, we don't install it anyway. + * Update Description. + * Update Homepage. + + -- Per Olofsson Sun, 04 Oct 2015 22:10:59 +0200 + +xdg-utils (1.1.0~rc3+git20150922-1) unstable; urgency=medium + + * Merge latest upstream git tree. + - xdg-icon-resource: Don't try to install anything into /. + Closes: #799741. + * Remove autotests/Makefile in distclean target. + + -- Per Olofsson Tue, 22 Sep 2015 10:20:04 +0200 + +xdg-utils (1.1.0~rc3+git20150919-1) unstable; urgency=medium + + * Rebase on latest upstream git tree. + - Drop the following patches which were applied upstream: + + xdg-email-detect-icedove.patch + + xdg-email-thunderbird-quoting.patch + + xdg-email-try-xdg-open.patch + + xdg-open-browser-multiword.diff + + xdg-open-printf.diff + + fix-bashism-use-of-echo.patch + * Maintain Debian patches in git instead of using quilt patches. + * Update git URLs in debian/control. + * xdg-open: Try $BROWSER first in generic mode if it is set by the + user. Closes: #799568. + * Add an automated test suite (under development). + + -- Per Olofsson Mon, 21 Sep 2015 07:04:31 +0200 + +xdg-utils (1.1.0~rc3+git20150907-2) unstable; urgency=medium + + * Add upstream bug URL to xdg-open-browser-multiword.diff. + * Use local variable in patch xdg-open-browser-multiword.diff. + * Add upstream bug URL to patch xdg-open-printf.diff. + * Add upstream bug URL to fix-bashism-use-of-echo.patch. + * Add xdg-email-try-xdg-open.patch: Try using xdg-open in xdg-email's + generic mode. Closes: #691259. + * Only try to auto-detect Mutt in xdg-email in generic mode after we + tried xdg-open. + * Add xdg-email-detect-icedove.patch: Also detect Icedove in xdg-email + for Thunderbird special handling. + * Add xdg-email-thunderbird-quoting.patch: Don't quote header fields + when calling Thunderbird from xdg-email. + * Drop patch xdg-email-mutt-detect.diff. Currently difficult to pinpoint + exactly when to use auto-detection. + + -- Per Olofsson Tue, 15 Sep 2015 07:06:25 +0200 + xdg-utils (1.1.0~rc3+git20150907-1ubuntu3) xenial; urgency=medium [ Iuri Chaer ] diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/control xdg-utils-1.1.1/debian/control --- xdg-utils-1.1.0~rc3+git20150907/debian/control 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/control 2015-10-05 15:15:40.000000000 -0400 @@ -1,14 +1,13 @@ Source: xdg-utils -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Per Olofsson +Maintainer: Per Olofsson Uploaders: Fathi Boudra Section: utils Priority: optional Standards-Version: 3.9.6 Build-Depends: debhelper (>= 9), xmlto, mawk | awk, w3m -Vcs-Git: git://git.debian.org/git/collab-maint/xdg-utils.git -Vcs-Browser: http://git.debian.org/?p=collab-maint/xdg-utils.git -Homepage: http://portland.freedesktop.org/ +Vcs-Git: git://anonscm.debian.org/collab-maint/xdg-utils.git +Vcs-Browser: http://anonscm.debian.org/cgit/collab-maint/xdg-utils.git +Homepage: http://www.freedesktop.org/wiki/Software/xdg-utils/ Package: xdg-utils Architecture: all @@ -24,14 +23,16 @@ . The following utilities are included: . - * xdg-desktop-menu - Install desktop menu items - * xdg-desktop-icon - Install icons on the user's desktop - * xdg-icon-resource - Install icon resources - * xdg-mime - Gather MIME information about a file - * xdg-open - Open a URL in the user's preferred application that - handles the respective URL or file type - * xdg-email - Open the user's preferred email client, potentially with - subject and other info filled in - * xdg-screensaver - Enable, disable, or suspend the screensaver - * xdg-settings - get various settings (default web browser) from - the desktop environment + * xdg-desktop-menu - Install desktop menu items + * xdg-desktop-icon - Install icons on the user's desktop + * xdg-email - Compose a new email in the user's preferred email client, + potentially with subject and other info filled in + * xdg-icon-resource - Install icon resources + * xdg-mime - Query and install MIME types and associations + * xdg-open - Open a URI in the user's preferred application that + handles the respective URI or file type + * xdg-screensaver - Enable, disable, or suspend the screensaver + * xdg-settings - Get or set the default web browser and URI handlers + . + If you are running GNOME, make sure that the gvfs-bin package is + installed. diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/filenames-with-spaces.patch xdg-utils-1.1.1/debian/patches/filenames-with-spaces.patch --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/filenames-with-spaces.patch 2015-09-16 16:31:14.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/filenames-with-spaces.patch 1969-12-31 19:00:00.000000000 -0500 @@ -1,26 +0,0 @@ -From f40c7e3d8d7fe1017ac087ed04aae8adc378379c Mon Sep 17 00:00:00 2001 -From: MestreLion -Date: Wed, 26 Aug 2015 03:23:14 -0300 -Subject: [PATCH 1/2] xdg-icon-resource: does not support filenames with - spaces (BR91758) - ---- - scripts/xdg-icon-resource.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/xdg-icon-resource.in b/scripts/xdg-icon-resource.in -index be1ad58..3ad1bc4 100644 ---- a/scripts/xdg-icon-resource.in -+++ b/scripts/xdg-icon-resource.in -@@ -394,7 +394,7 @@ icon_icon_file=`echo "$icon_file" | sed 's/\.[a-z][a-z][a-z]$/.icon/'` - icon_icon_name="$icon_name.icon" - - DEBUG 1 "$action icon in $xdg_dir" --[ $action = "install" ] && [ -f $icon_icon_file ] && DEBUG 1 "install $icon_icon_name meta file in $xdg_dir" -+[ $action = "install" ] && [ -f "$icon_icon_file" ] && DEBUG 1 "install $icon_icon_name meta file in $xdg_dir" - [ -n "$kde_dir" ] && DEBUG 1 "$action symlink in $kde_dir (KDE 3.x support)" - [ -n "$need_gnome_mime" ] && DEBUG 1 "$action gnome-mime-$icon_name symlink (GNOME 2.x support)" - [ $action = "install" -a -n "$dot_icon_dir" ] && DEBUG 1 "$action ~/.icons symlink (GNOME 2.8 support)" --- -1.7.9.5 - diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/fix-bashism-use-of-echo.patch xdg-utils-1.1.1/debian/patches/fix-bashism-use-of-echo.patch --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/fix-bashism-use-of-echo.patch 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/fix-bashism-use-of-echo.patch 1969-12-31 19:00:00.000000000 -0500 @@ -1,27 +0,0 @@ -Description: Use /bin/echo -e instead of echo -e in xdg-email -Origin: vendor -Bug-Debian: https://bugs.debian.org/685078 -Bug-Debian: https://bugs.debian.org/691182 -Forwarded: no -Author: Salvatore Bonaccorso -Last-Update: 2014-04-03 - ---- a/scripts/xdg-email.in -+++ b/scripts/xdg-email.in -@@ -43,12 +43,12 @@ - fi - - MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g') -- TO=$(echo -e $(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) -- CC=$(echo -e $(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) -- BCC=$(echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) -+ TO=$(/bin/echo -e $(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) -+ CC=$(/bin/echo -e $(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) -+ BCC=$(/bin/echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) - SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1) - BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1) -- ATTACH=$(echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')) -+ ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')) - - if [ -z "$TO" ] ; then - NEWMAILTO= diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/gnome-3.0.diff xdg-utils-1.1.1/debian/patches/gnome-3.0.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/gnome-3.0.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/gnome-3.0.diff 1969-12-31 19:00:00.000000000 -0500 @@ -1,90 +0,0 @@ -Description: Make the default mail client and browser settings work with the - x-scheme-handler method of registering URI handlers in gnome3. Note, this is loosely - based on http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=6f49c05ceb2a1935d07c49c2e100b5cf3cdf5f26, - however, we don't maintain separate methods for gnome and gnome3. The upstream gnome3 - detection doesn't work on Natty because we're not really using gnome3. In addition to this, - when we set the defaults we use both the new and old methods so that we preserve the - functionality of legacy apps using gnomevfs. - - This also contains additional changes to get/set default mimetype handlers from the users - mimeapps.list rather than defaults.list, which isn't used by anything - (see http://www.freedesktop.org/wiki/Specifications/mime-actions-spec) -Author: Bastien Nocera -Author: Chris Coulson -Bug-Ubuntu: https://launchpad.net/bugs/670128 -Last-Update: 2015-09-13 - ---- a/scripts/xdg-email.in -+++ b/scripts/xdg-email.in -@@ -154,7 +154,9 @@ - open_gnome() - { - local client -- client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || "" -+ local desktop -+ desktop=`xdg-mime query default "x-scheme-handler/mailto"` -+ client=`desktop_file_to_binary "$browser"` - echo $client | grep thunderbird > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - run_thunderbird "$client" "$1" ---- a/scripts/xdg-settings.in -+++ b/scripts/xdg-settings.in -@@ -257,32 +257,32 @@ - - get_browser_gnome() - { -- binary="`gconftool-2 --get /desktop/gnome/applications/browser/exec | first_word`" -- if [ x"$binary" = x ]; then -- # No default browser; GNOME might use the MIME type text/html. -- get_browser_mime -- else -- # gconftool gives the binary (maybe with %s etc. afterward), -- # but we want the desktop file name, not the binary. So, we -- # have to find the desktop file to which it corresponds. -- desktop="`binary_to_desktop_file "$binary"`" -- basename "$desktop" -- fi -+ get_browser_mime "x-scheme-handler/http" - } - - check_browser_gnome() - { -+ desktop="$1" - check="`desktop_file_to_binary "$1"`" - if [ -z "$check" ]; then - echo no - exit_success - fi -+ # Check HTTP and HTTPS, but not about: and unknown:, using the GNOME 3 scheme. -+ for protocol in http https; do -+ browser="`get_browser_mime "x-scheme-handler/$protocol"`" -+ if [ x"$browser" != x"$desktop" ]; then -+ echo no -+ exit_success -+ fi -+ done -+ - binary="`gconftool-2 --get /desktop/gnome/applications/browser/exec | first_word`" - if [ x"$binary" != x"$check" ]; then - echo no - exit_success - fi -- # Check HTTP and HTTPS, but not about: and unknown:. -+ # Check HTTP and HTTPS, but not about: and unknown:, using the legacy GNOME scheme. - for protocol in http https; do - binary="`gconftool-2 --get /desktop/gnome/url-handlers/$protocol/command | first_word`" - if [ x"$binary" != x"$check" ]; then -@@ -306,7 +306,12 @@ - [ "$binary" ] || exit_failure_file_missing - set_browser_mime "$1" || return - -- # Set the default browser. -+ # Set the default browser using the GNOME 3 scheme. -+ for protocol in http https about unknown; do -+ set_browser_mime "$1" "x-scheme-handler/$protocol" || return -+ done -+ -+ # Set the default browser using the legacy GNOME scheme. - gconftool-2 --type string --set /desktop/gnome/applications/browser/exec "$binary" - gconftool-2 --type bool --set /desktop/gnome/applications/browser/needs_term false - gconftool-2 --type bool --set /desktop/gnome/applications/browser/nremote true diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/handle-multiple-exec-lines.patch xdg-utils-1.1.1/debian/patches/handle-multiple-exec-lines.patch --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/handle-multiple-exec-lines.patch 2015-11-19 16:55:31.000000000 -0500 +++ xdg-utils-1.1.1/debian/patches/handle-multiple-exec-lines.patch 1969-12-31 19:00:00.000000000 -0500 @@ -1,35 +0,0 @@ -Index: xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-settings.in -=================================================================== ---- xdg-utils-1.1.0~rc3+git20150907.orig/scripts/xdg-settings.in -+++ xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-settings.in -@@ -426,7 +426,7 @@ check_xfce_desktop_file() - sed -e 's/^Type=.*/Type=X-XFCE-Helper/' -e '/^Exec[=[]/,$d' "$file" > "$target/$1" - echo "X-XFCE-Category=WebBrowser" >> "$target/$1" - # Change %F, %f, %U, and %u to "%s". -- command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/%[FfUu]/"%s"/g' | head -1`" -+ command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | head -n1 | cut -d= -f 2- | sed -e 's/%[FfUu]/"%s"/g'`" - echo "X-XFCE-Commands=`echo "$command" | first_word`" >> "$target/$1" - echo "X-XFCE-CommandsWithParameter=$command" >> "$target/$1" - # Copy rest of file (from first "Exec=" line to end-of-file). -Index: xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-utils-common.in -=================================================================== ---- xdg-utils-1.1.0~rc3+git20150907.orig/scripts/xdg-utils-common.in -+++ xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-utils-common.in -@@ -37,7 +37,7 @@ binary_to_desktop_file() - grep -q "^Exec.*$base" "$file" || continue - # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop"). - grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue -- command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" -+ command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | head -n1 | cut -d= -f 2- | first_word`" - command="`which "$command"`" - if [ x"`readlink -f "$command"`" = x"$binary" ]; then - # Fix any double slashes that got added path composition -@@ -62,7 +62,7 @@ desktop_file_to_binary() - file="$dir/applications/$desktop" - [ -r "$file" ] || continue - # Remove any arguments (%F, %f, %U, %u, etc.). -- command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/ .*$//'`" -+ command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | head -n1 | cut -d= -f 2- | sed -e 's/ .*$//'`" - command="`which "$command"`" - readlink -f "$command" - return diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/lp779156-lubuntu.diff xdg-utils-1.1.1/debian/patches/lp779156-lubuntu.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/lp779156-lubuntu.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/lp779156-lubuntu.diff 2016-01-20 11:37:23.000000000 -0500 @@ -4,22 +4,11 @@ - Added open_lxde shell function, used when LXDE detected. - Added run_sylpheed function, used to call sylpheed (LP: 779156). Bug-Ubuntu: https://launchpad.net/bugs/779156 -Last-Update: 2015-09-13 +Last-Update: 2016-01-20 ---- a/scripts/xdg-utils-common.in -+++ b/scripts/xdg-utils-common.in -@@ -62,7 +62,7 @@ - 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="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/ .*$//'`" - command="`which "$command"`" - readlink -f "$command" - return --- a/scripts/xdg-email.in +++ b/scripts/xdg-email.in -@@ -82,6 +82,17 @@ +@@ -82,6 +82,17 @@ run_thunderbird() fi } @@ -36,8 +25,8 @@ + open_kde() { - local client kde_email_profile_name -@@ -207,6 +218,39 @@ + if [ -n "$KDE_SESSION_VERSION" ] && [ "$KDE_SESSION_VERSION" -ge 5 ]; then +@@ -213,6 +224,39 @@ open_envvar() exit_failure_operation_failed } @@ -77,7 +66,7 @@ open_generic() { local client -@@ -461,6 +505,10 @@ +@@ -469,6 +513,10 @@ case "$DE" in open_xfce "${mailto}" ;; diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/mimeappslist-file-location xdg-utils-1.1.1/debian/patches/mimeappslist-file-location --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/mimeappslist-file-location 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/debian/patches/mimeappslist-file-location 2016-01-20 11:41:35.000000000 -0500 @@ -0,0 +1,38 @@ +Description: xdg-mime reads from .config/mimeapps.list but never writes to it. +Author: Chad MILLER +Forwarded: no +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1518053 + +--- a/scripts/xdg-mime.in ++++ b/scripts/xdg-mime.in +@@ -239,13 +239,17 @@ make_default_generic() + # $1 is vendor-name.desktop + # $2 is mime/type + # Add $2=$1 to XDG_DATA_HOME/applications/mimeapps.list ++ + xdg_user_dir="$XDG_DATA_HOME" + [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" +- default_file="$xdg_user_dir/applications/mimeapps.list" +- DEBUG 2 "make_default_generic $1 $2" +- DEBUG 1 "Updating $default_file" +- [ -f "$default_file" ] || touch "$default_file" +- awk -v mimetype="$2" -v application="$1" ' ++ xdg_config_home="$XDG_CONFIG_HOME" ++ [ -n "$xdg_config_home" ] || xdg_config_home="$HOME/.config" ++ ++ for default_file in "$xdg_user_dir/applications/mimeapps.list" "$xdg_config_home/mimeapps.list"; do ++ DEBUG 2 "make_default_generic $1 $2" ++ DEBUG 1 "Updating $default_file" ++ [ -f "$default_file" ] || touch "$default_file" ++ awk -v mimetype="$2" -v application="$1" ' + BEGIN { + prefix=mimetype "=" + indefault=0 +@@ -293,6 +297,7 @@ make_default_generic() + } + } + ' "$default_file" > "${default_file}.new" && mv "${default_file}.new" "$default_file" ++done + } + + search_desktop_file() diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/no-X.diff xdg-utils-1.1.1/debian/patches/no-X.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/no-X.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/no-X.diff 1969-12-31 19:00:00.000000000 -0500 @@ -1,72 +0,0 @@ ---- a/scripts/xdg-open.in -+++ b/scripts/xdg-open.in -@@ -291,8 +291,10 @@ open_generic() - file_check=${file_check%%\?*} - check_input_file "$file_check" - -- filetype=`xdg-mime query filetype "$file_check" | sed "s/;.*//"` -- open_generic_xdg_mime "$file" "$filetype" -+ if [ -n "$DISPLAY" ]; then -+ filetype=`xdg-mime query filetype "$file_check" | sed "s/;.*//"` -+ open_generic_xdg_mime "$file" "$filetype" -+ fi - - if which run-mailcap 2>/dev/null 1>&2; then - run-mailcap --action=view "$file" -@@ -301,7 +303,7 @@ open_generic() - fi - fi - -- if mimeopen -v 2>/dev/null 1>&2; then -+ if [ -n "$DISPLAY" ] && mimeopen -v 2>/dev/null 1>&2; then - mimeopen -L -n "$file" - if [ $? -eq 0 ]; then - exit_success -@@ -309,7 +311,9 @@ open_generic() - fi - fi - -- open_generic_xdg_x_scheme_handler "$1" -+ if [ -n "$DISPLAY" ]; then -+ open_generic_xdg_x_scheme_handler "$1" -+ fi - - OLDIFS="$IFS" - IFS=":" -@@ -322,9 +326,14 @@ open_generic() - browser_with_arg=$browser; - fi - -+ local redirect_output= -+ if [ -n "$DISPLAY" ]; then -+ redirect_output="$xdg_redirect_output" -+ fi -+ - if [ x"$browser_with_arg" = x"$browser" ]; then -- eval '$browser "$1"'$xdg_redirect_output; -- else eval '$browser_with_arg'$xdg_redirect_output; -+ eval '$browser "$1"'$redirect_output; -+ else eval '$browser_with_arg'$redirect_output; - fi - - if [ $? -eq 0 ]; then -@@ -407,7 +416,7 @@ esac - - # if BROWSER variable is not set, check some well known browsers instead - if [ x"$BROWSER" = x"" ]; then -- BROWSER=links2:elinks:links:lynx:w3m -+ BROWSER=www-browser:links2:elinks:links:lynx:w3m - if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER - fi ---- a/scripts/xdg-email.in -+++ b/scripts/xdg-email.in -@@ -432,7 +432,7 @@ fi - - # if BROWSER variable is not set, check some well known browsers instead - if [ x"$BROWSER" = x"" ]; then -- BROWSER=links2:elinks:links:lynx:w3m -+ BROWSER=www-browser:links2:elinks:links:lynx:w3m - if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER - fi diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/series xdg-utils-1.1.1/debian/patches/series --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/series 2015-11-19 16:52:34.000000000 -0500 +++ xdg-utils-1.1.1/debian/patches/series 2016-01-08 12:09:13.000000000 -0500 @@ -1,12 +1,4 @@ -xdg-email-envvar.diff xdg-email-mutt-detect.diff -xdg-open-browser-multiword.diff -xdg-open-printf.diff -xdg-screensaver-new-gnome.diff -no-X.diff -fix-bashism-use-of-echo.patch -gnome-3.0.diff lp779156-lubuntu.diff xdg-screensaver-restore-timeout.diff -filenames-with-spaces.patch -handle-multiple-exec-lines.patch +mimeappslist-file-location diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-email-envvar.diff xdg-utils-1.1.1/debian/patches/xdg-email-envvar.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-email-envvar.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/xdg-email-envvar.diff 1969-12-31 19:00:00.000000000 -0500 @@ -1,53 +0,0 @@ -Description: Add $MAILER support to xdg-email. -Bug: https://bugs.freedesktop.org/show_bug.cgi?id=6615 -Bug-Debian: http://bugs.debian.org/574131 -Author: Per Olofsson - ---- a/scripts/xdg-email.in -+++ b/scripts/xdg-email.in -@@ -188,6 +188,23 @@ open_xfce() - fi - } - -+open_envvar() -+{ -+ local OLDIFS="$IFS" -+ IFS=: -+ for i in $MAILER; do -+ IFS="$OLDIFS" -+ -+ eval "$i" '"$1"' -+ -+ if [ $? -eq 0 ]; then -+ exit_success -+ fi -+ done -+ -+ exit_failure_operation_failed -+} -+ - open_generic() - { - local client -@@ -399,6 +416,10 @@ if [ x"$DE" = x"" ]; then - DE=generic - fi - -+if [ x"$MAILER" != x"" ]; then -+ DE=envvar -+fi -+ - # if BROWSER variable is not set, check some well known browsers instead - if [ x"$BROWSER" = x"" ]; then - BROWSER=links2:elinks:links:lynx:w3m -@@ -408,6 +429,10 @@ if [ x"$BROWSER" = x"" ]; then - fi - - case "$DE" in -+ envvar) -+ open_envvar "${mailto}" -+ ;; -+ - kde) - open_kde "${mailto}" - ;; diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-email-mutt-detect.diff xdg-utils-1.1.1/debian/patches/xdg-email-mutt-detect.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-email-mutt-detect.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/xdg-email-mutt-detect.diff 2016-01-04 10:02:44.000000000 -0500 @@ -2,7 +2,7 @@ Author: Per Olofsson --- a/scripts/xdg-email.in +++ b/scripts/xdg-email.in -@@ -416,6 +416,16 @@ if [ x"$DE" = x"" ]; then +@@ -426,6 +426,16 @@ if [ x"$DE" = x"" ]; then DE=generic fi diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-open-browser-multiword.diff xdg-utils-1.1.1/debian/patches/xdg-open-browser-multiword.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-open-browser-multiword.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/xdg-open-browser-multiword.diff 1969-12-31 19:00:00.000000000 -0500 @@ -1,16 +0,0 @@ -Description: Fix support for multi-word $BROWSER commands. -Author: Per Olofsson -Bug-Debian: http://bugs.debian.org/612339 ---- a/scripts/xdg-open.in -+++ b/scripts/xdg-open.in -@@ -307,8 +307,10 @@ open_generic() - - open_generic_xdg_x_scheme_handler "$1" - -+ OLDIFS="$IFS" - IFS=":" - for browser in $BROWSER; do -+ IFS="$OLDIFS" - if [ x"$browser" != x"" ]; then - - browser_with_arg=`printf "$browser" "$1" 2>/dev/null` diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-open-printf.diff xdg-utils-1.1.1/debian/patches/xdg-open-printf.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-open-printf.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/xdg-open-printf.diff 1969-12-31 19:00:00.000000000 -0500 @@ -1,20 +0,0 @@ -Description: Use /usr/bin/printf if available when decoding URLs. - dash's printf doesn't understand \xHH sequences. -Author: Per Olofsson -Bug: http://bugs.debian.org/613272 - ---- a/scripts/xdg-open.in -+++ b/scripts/xdg-open.in -@@ -281,7 +281,11 @@ open_generic() - # Decode URLs - if echo "$file" | grep -q '^file:///'; then - file=${file#file://} -- file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" -+ local printf=printf -+ if [ -x /usr/bin/printf ]; then -+ printf=/usr/bin/printf -+ fi -+ file="$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" - fi - file_check=${file%%#*} - file_check=${file_check%%\?*} diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-screensaver-new-gnome.diff xdg-utils-1.1.1/debian/patches/xdg-screensaver-new-gnome.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-screensaver-new-gnome.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/xdg-screensaver-new-gnome.diff 1969-12-31 19:00:00.000000000 -0500 @@ -1,70 +0,0 @@ -Description: Use DBus API for GNOME since gnome-screensaver-command --poke - has been removed -Author: Ben Hutchings -Bug: http://bugs.debian.org/610155 - ---- a/scripts/xdg-screensaver.in -+++ b/scripts/xdg-screensaver.in -@@ -442,14 +442,54 @@ screensaver_gnome_screensaver() - # http://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html - case "$1" in - suspend) -- screensaver_suspend_loop \ -- dbus-send --session \ -- --dest=org.gnome.ScreenSaver \ -- --type=method_call \ -- /org/gnome/ScreenSaver \ -- org.gnome.ScreenSaver.SimulateUserActivity \ -- 2> /dev/null -- result=$? -+ perl -e ' -+use strict; -+use warnings; -+use IO::File; -+use Net::DBus; -+use X11::Protocol; -+ -+my ($window_id, $screensaver_file) = @ARGV; -+ -+# Find window name to pass to session manager. -+my $x = X11::Protocol->new(); -+my $named_window_id = hex($window_id); -+my $window_name; -+while (1) { -+ ($window_name) = $x->GetProperty($named_window_id, $x->atom("WM_NAME"), -+ $x->atom("STRING"), 0, 1000, 0); -+ last if defined($window_name) && $window_name ne ""; -+ (undef, $named_window_id) = $x->QueryTree($named_window_id); -+ if (!defined($named_window_id)) { -+ $window_name = "?"; -+ last; -+ } -+} -+ -+# 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(); -+my $sm_svc = $bus->get_service("org.gnome.SessionManager"); -+my $sm = $sm_svc->get_object("/org/gnome/SessionManager", -+ "org.gnome.SessionManager"); -+$sm->Inhibit($window_name, hex($window_id), $window_name, 8); -+ -+# Wait until removed from the status file. -+while (1) { -+ sleep(10); -+ my $status = new IO::File($screensaver_file, "r") -+ or exit 0; -+ my $found; -+ while (<$status>) { -+ if (/^$window_id:/) { -+ $found = 1; -+ last; -+ } -+ } -+ exit 0 unless $found; -+} -+' $window_id $screensaver_file & -+ result=0 - ;; - - resume) diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-screensaver-restore-timeout.diff xdg-utils-1.1.1/debian/patches/xdg-screensaver-restore-timeout.diff --- xdg-utils-1.1.0~rc3+git20150907/debian/patches/xdg-screensaver-restore-timeout.diff 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/patches/xdg-screensaver-restore-timeout.diff 2016-01-20 11:42:32.000000000 -0500 @@ -1,12 +1,13 @@ Description: Restore previous X11 screensaver timeout (xdg-screensaver) Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88210 -Ubuntu-Bug: https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1363540 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1363540 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=+745340 Author: Thaddaeus Tintenfisch Last-Update: 2015-09-13 --- a/scripts/xdg-screensaver.in +++ b/scripts/xdg-screensaver.in -@@ -366,16 +366,29 @@ +@@ -372,16 +372,29 @@ screensaver_kde3() esac } @@ -38,7 +39,7 @@ result=$? ;; -@@ -390,7 +403,7 @@ +@@ -396,7 +409,7 @@ screensaver_xserver() ;; status) diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/rules xdg-utils-1.1.1/debian/rules --- xdg-utils-1.1.0~rc3+git20150907/debian/rules 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/rules 2015-10-05 15:12:08.000000000 -0400 @@ -13,7 +13,6 @@ fi; \ done cd scripts && LC_ALL=C.UTF-8 make scripts man - dh_auto_build override_dh_auto_clean: dh_auto_clean @@ -25,5 +24,5 @@ done -rm scripts/html/index.html -# don't test, the tests require a desktop environment override_dh_auto_test: + make autotest diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/source/options xdg-utils-1.1.1/debian/source/options --- xdg-utils-1.1.0~rc3+git20150907/debian/source/options 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/debian/source/options 2015-10-05 15:12:08.000000000 -0400 @@ -0,0 +1 @@ +single-debian-patch diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/source/patch-header xdg-utils-1.1.1/debian/source/patch-header --- xdg-utils-1.1.0~rc3+git20150907/debian/source/patch-header 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/debian/source/patch-header 2015-10-05 15:12:08.000000000 -0400 @@ -0,0 +1,10 @@ +Description: Collected Debian patches for xdg-utils +Author: Per Olofsson + +The xdg-utils package is maintained in Git rather than maintaining +patches as separate files, and separating the patches doesn't seem to +be worth the effort. They are therefore all included in this single +Debian patch. + +For full commit history and separated commits, see the packaging Git +repository. diff -Nru xdg-utils-1.1.0~rc3+git20150907/debian/watch xdg-utils-1.1.1/debian/watch --- xdg-utils-1.1.0~rc3+git20150907/debian/watch 2015-09-13 19:18:56.000000000 -0400 +++ xdg-utils-1.1.1/debian/watch 2015-10-05 15:12:08.000000000 -0400 @@ -1,6 +1,3 @@ version=3 opts="uversionmangle=s/-rc/\~rc/" \ http://portland.freedesktop.org/download/xdg-utils-(\d[\d.]*(?:-rc\d+)?)\.tar\.gz - -opts="uversionmangle=s/-rc/\~rc/" \ - http://people.freedesktop.org/~rdieter/xdg-utils/xdg-utils-(\d[\d.]*(?:-rc\d+)?)\.tar\.gz diff -Nru xdg-utils-1.1.0~rc3+git20150907/.dir-locals.el xdg-utils-1.1.1/.dir-locals.el --- xdg-utils-1.1.0~rc3+git20150907/.dir-locals.el 1969-12-31 19:00:00.000000000 -0500 +++ xdg-utils-1.1.1/.dir-locals.el 2015-10-05 14:59:19.000000000 -0400 @@ -0,0 +1 @@ +(("ChangeLog" . ((nil . ((mode . fundamental)))))) diff -Nru xdg-utils-1.1.0~rc3+git20150907/Makefile.in xdg-utils-1.1.1/Makefile.in --- xdg-utils-1.1.0~rc3+git20150907/Makefile.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/Makefile.in 2015-10-05 14:59:19.000000000 -0400 @@ -1,10 +1,12 @@ -SUBDIRS = scripts tests +SUBDIRS = scripts tests autotests all: $(SUBDIRS) install: $(SUBDIRS:%=%/__install__) uninstall: $(SUBDIRS:%=%/__uninstall__) test: dummy cd tests && $(MAKE) test +autotest: + cd autotests && $(MAKE) test clean: $(SUBDIRS:%=%/__clean__) distclean: clean $(SUBDIRS:%=%/__distclean__) rm -f config.* Makefile @@ -16,7 +18,7 @@ help: @echo "Usage: make [install|uninstall|release]" -.PHONY: all install uninstall clean distclean dummy +.PHONY: all install uninstall clean distclean dummy autotest dummy: $(SUBDIRS): dummy diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-desktop-menu.xml xdg-utils-1.1.1/scripts/desc/xdg-desktop-menu.xml --- xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-desktop-menu.xml 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/desc/xdg-desktop-menu.xml 2015-10-05 14:59:19.000000000 -0400 @@ -537,7 +537,9 @@ , xdg-mime 1 - + , + Desktop entry specification, + Desktop menu specification diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-email.xml xdg-utils-1.1.1/scripts/desc/xdg-email.xml --- xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-email.xml 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/desc/xdg-email.xml 2015-10-05 14:59:19.000000000 -0400 @@ -79,10 +79,6 @@ xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root. - - See for information on - how the user can change the e-mail composer that is used. - Options @@ -250,12 +246,22 @@ - - Configuration - Visit for information - how to configure xdg-email to use the email client of your choice. + + See Also + + + xdg-open + 1 + , + + xdg-mime + 1 + , + MIME applications associations specification, + RFC 6068 - The 'mailto' URI Scheme + Examples diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-icon-resource.xml xdg-utils-1.1.1/scripts/desc/xdg-icon-resource.xml --- xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-icon-resource.xml 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/desc/xdg-icon-resource.xml 2015-10-05 14:59:19.000000000 -0400 @@ -348,7 +348,8 @@ , xdg-mime 1 - + , + Icon theme specification diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-mime.xml xdg-utils-1.1.1/scripts/desc/xdg-mime.xml --- xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-mime.xml 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/desc/xdg-mime.xml 2015-10-05 14:59:19.000000000 -0400 @@ -329,7 +329,9 @@ , xdg-desktop-menu 1 - + , + Shared MIME database specification, + MIME applications associations specification diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-open.xml xdg-utils-1.1.1/scripts/desc/xdg-open.xml --- xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-open.xml 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/desc/xdg-open.xml 2015-10-05 14:59:19.000000000 -0400 @@ -137,6 +137,18 @@ + + See Also + xdg-mime + 1 + , + xdg-settings + 1 + , + MIME applications associations specification + + + Examples diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-settings.xml xdg-utils-1.1.1/scripts/desc/xdg-settings.xml --- xdg-utils-1.1.0~rc3+git20150907/scripts/desc/xdg-settings.xml 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/desc/xdg-settings.xml 2015-10-05 14:59:19.000000000 -0400 @@ -15,7 +15,7 @@ Mammarella
mdm@google.com
- + xdg-utils 1.1.0 @@ -165,6 +165,17 @@
+ + See Also + xdg-mime + 1 + , + xdg-open + 1 + , + MIME applications associations specification + + Examples diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-email.in xdg-utils-1.1.1/scripts/xdg-email.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-email.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-email.in 2015-10-05 14:59:19.000000000 -0400 @@ -43,12 +43,12 @@ fi MAILTO=$(echo "$MAILTO" | sed 's/&/\n/g') - TO=$(echo -e $(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) - CC=$(echo -e $(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) - BCC=$(echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "\"%s\",",$0 }')) + TO=$(/bin/echo -e $(echo "$MAILTO" | grep '^to=' | sed 's/^to=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')) + CC=$(/bin/echo -e $(echo "$MAILTO" | grep '^cc=' | sed 's/^cc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')) + BCC=$(/bin/echo -e $(echo "$MAILTO" | grep '^bcc=' | sed 's/^bcc=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }')) SUBJECT=$(echo "$MAILTO" | grep '^subject=' | tail -n 1) BODY=$(echo "$MAILTO" | grep '^body=' | tail -n 1) - ATTACH=$(echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')) + ATTACH=$(/bin/echo -e $(echo "$MAILTO" | grep '^attach=' | sed 's/^attach=//;s/%\(..\)/\\x\1/g' | awk '{ printf "%s,",$0 }' | sed 's/,$//')) if [ -z "$TO" ] ; then NEWMAILTO= @@ -84,41 +84,49 @@ open_kde() { - local client kde_email_profile_name - if [ x"${KDE_SESSION_VERSION}" = x"5" ]; then - kde_email_profile_name=`kreadconfig5 --file emaildefaults --group Defaults --key Profile` - client=`kreadconfig5 --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1` + if [ -n "$KDE_SESSION_VERSION" ] && [ "$KDE_SESSION_VERSION" -ge 5 ]; then + local kreadconfig=kreadconfig$KDE_SESSION_VERSION else - kde_email_profile_name=`kreadconfig --file emaildefaults --group Defaults --key Profile` - client=`kreadconfig --file emaildefaults --group PROFILE_"$kde_email_profile_name" --key EmailClient | cut -d ' ' -f 1` - fi - echo $client | grep thunderbird > /dev/null 2>&1 - if [ $? -eq 0 ] ; then - run_thunderbird "$client" "$1" + local kreadconfig=kreadconfig fi - if [ -f /etc/SuSE-release ] ; then - # Workaround for SUSE 10.0 - [ -z "$client" ] && client="kmail" - if ! which "$client" > /dev/null 2> /dev/null; then - DEBUG 3 "KDE has $client configured as email client which isn't installed" - if which gnome-open > /dev/null 2> /dev/null && which evolution > /dev/null 2> /dev/null; then - DEBUG 3 "Try gnome-open instead" - open_gnome "$1" + if which $kreadconfig >/dev/null 2>&1; then + local profile=$($kreadconfig --file emaildefaults \ + --group Defaults --key Profile) + if [ -n "$profile" ]; then + local client=$($kreadconfig --file emaildefaults \ + --group "PROFILE_$profile" \ + --key EmailClient \ + | cut -d ' ' -f 1) + + if echo "$client" | grep -Eq 'thunderbird|icedove'; then + run_thunderbird "$client" "$1" fi fi fi - DEBUG 1 "Running kmailservice \"$1\"" - if [ x"$KDE_SESSION_VERSION" = x"4" ]; then - KMAILSERVICE=`kde4-config --locate kmailservice --path exe 2>/dev/null` - $KMAILSERVICE "$1" - else - KMAILSERVICE=`which kmailservice 2>/dev/null` - # KDE3 uses locale's encoding when decoding the URI, so set it to UTF-8 - LC_ALL=C.UTF-8 $KMAILSERVICE "$1" + + local command + case "$KDE_SESSION_VERSION" in + '') command=kmailservice ;; + 4) command=kde-open ;; + *) command=kde-open$KDE_SESSION_VERSION ;; + esac + + if which $command >/dev/null 2>&1; then + DEBUG 1 "Running $command \"$1\"" + if [ "$KDE_SESSION_VERSION" = 3 ]; then + # KDE3 uses locale's encoding when decoding the URI, + # so set it to UTF-8 + LC_ALL=C.UTF-8 $command "$1" + else + $command "$1" + fi + else + DEBUG 1 "$command missing; trying generic mode instead." + open_generic "$1" fi - if [ $? -eq 0 ]; then + if [ $? = 0 ]; then exit_success else exit_failure_operation_failed @@ -131,7 +139,7 @@ local desktop desktop=`xdg-mime query default "x-scheme-handler/mailto"` client=`desktop_file_to_binary "$desktop"` - echo $client | grep thunderbird > /dev/null 2>&1 + echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi @@ -155,7 +163,7 @@ { local client client=`gconftool-2 --get /desktop/gnome/url-handlers/mailto/command | cut -d ' ' -f 1` || "" - echo $client | grep thunderbird > /dev/null 2>&1 + echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi @@ -188,21 +196,40 @@ fi } +open_envvar() +{ + local OLDIFS="$IFS" + IFS=: + for i in $MAILER; do + IFS="$OLDIFS" + + eval "$i" '"$1"' + + if [ $? -eq 0 ]; then + exit_success + fi + done + + exit_failure_operation_failed +} + open_generic() { local client local desktop desktop=`xdg-mime query default "x-scheme-handler/mailto"` client=`desktop_file_to_binary "$desktop"` - echo $client | grep thunderbird > /dev/null 2>&1 + echo $client | grep -E 'thunderbird|icedove' > /dev/null 2>&1 if [ $? -eq 0 ] ; then run_thunderbird "$client" "$1" fi - if [ $? -eq 0 ]; then - exit_success - else - exit_failure_operation_failed + xdg-open "$1" + local ret=$? + + # 3 means exit_failure_operation_impossible + if [ $ret != 3 ]; then + exit $ret fi IFS=":" @@ -399,15 +426,23 @@ DE=generic fi +if [ x"$MAILER" != x"" ]; then + DE=envvar +fi + # if BROWSER variable is not set, check some well known browsers instead if [ x"$BROWSER" = x"" ]; then - BROWSER=links2:elinks:links:lynx:w3m + BROWSER=www-browser:links2:elinks:links:lynx:w3m if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER + BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi fi case "$DE" in + envvar) + open_envvar "${mailto}" + ;; + kde) open_kde "${mailto}" ;; diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-icon-resource.in xdg-utils-1.1.1/scripts/xdg-icon-resource.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-icon-resource.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-icon-resource.in 2015-10-05 14:59:19.000000000 -0400 @@ -205,7 +205,7 @@ fi if [ -z "$mode" ] ; then - if [ `whoami` = "root" ] ; then + if [ "`whoami`" = "root" ] ; then mode="system" else mode="user" @@ -224,13 +224,13 @@ xdg_system_dirs="$XDG_DATA_DIRS" [ -n "$xdg_system_dirs" ] || xdg_system_dirs="/usr/local/share/:/usr/share/" for x in `echo "$xdg_system_dirs" | sed 's/:/ /g'`; do - if [ -w $x/$xdg_dir_name ] ; then + if [ -w "$x/$xdg_dir_name" ] ; then xdg_global_prefix="$x/icons" xdg_global_dir="$x/$xdg_dir_name" break fi done -[ -w $xdg_global_dir ] || xdg_global_dir= +[ -w "$xdg_global_dir" ] || xdg_global_dir= dot_icon_dir= dot_base_dir= @@ -255,7 +255,7 @@ update_icon_database $xdg_base_dir if [ -n "$dot_icon_dir" ] ; then if [ -d "$dot_icon_dir/" ] && [ ! -L "$dot_icon_dir" ] ; then - update_icon_database $dot_base_dir + update_icon_database "$dot_base_dir" fi fi exit_success @@ -278,7 +278,7 @@ xdg_size_name="${size}x${size}" if [ x"$action" = x"install" ] ; then - case $icon_file in + case "$icon_file" in *.xpm) extension="xpm" ;; @@ -292,7 +292,7 @@ fi if [ -n "$icon_name" ] ; then - case $icon_name in + case "$icon_name" in *.png) exit_failure_syntax "icon name should not include an extension" ;; @@ -336,8 +336,8 @@ fi done DEBUG 2 "kde_global_prefix: $kde_global_prefix" - [ $needed -eq "1" ] && DEBUG 2 "need_kde_icon_path RETURN $needed (not needed)" - [ $needed -eq "0" ] && DEBUG 2 "need_kde_icon_path RETURN $needed (needed)" + [ $needed -eq 1 ] && DEBUG 2 "need_kde_icon_path RETURN $needed (not needed)" + [ $needed -eq 0 ] && DEBUG 2 "need_kde_icon_path RETURN $needed (needed)" return $needed } @@ -381,7 +381,7 @@ # Start GNOME legacy workaround section need_gnome_mime= -[ $context = "mimetypes" ] && need_gnome_mime=true +[ "$context" = "mimetypes" ] && need_gnome_mime=true # End GNOME legacy workaround section [ -n "$icon_name" ] || icon_name=`basename "$icon_file" | sed 's/\.[a-z][a-z][a-z]$//'` @@ -394,18 +394,19 @@ icon_icon_name="$icon_name.icon" DEBUG 1 "$action icon in $xdg_dir" -[ $action = "install" ] && [ -f $icon_icon_file ] && DEBUG 1 "install $icon_icon_name meta file in $xdg_dir" +[ "$action" = "install" ] && [ -f "$icon_icon_file" ] && DEBUG 1 "install $icon_icon_name meta file in $xdg_dir" [ -n "$kde_dir" ] && DEBUG 1 "$action symlink in $kde_dir (KDE 3.x support)" [ -n "$need_gnome_mime" ] && DEBUG 1 "$action gnome-mime-$icon_name symlink (GNOME 2.x support)" -[ $action = "install" -a -n "$dot_icon_dir" ] && DEBUG 1 "$action ~/.icons symlink (GNOME 2.8 support)" +[ "$action" = "install" -a -n "$dot_icon_dir" ] && DEBUG 1 "$action ~/.icons symlink (GNOME 2.8 support)" -case $action in +case "$action" in install) save_umask=`umask` umask $my_umask - for icon_dir in $xdg_dir $dot_icon_dir; do - mkdir -p $icon_dir + for icon_dir in "$xdg_dir" "$dot_icon_dir"; do + [ -z "$icon_dir" ] && continue + mkdir -p "$icon_dir" eval 'cp "$icon_file" "$icon_dir/$icon_name.$extension"'$xdg_redirect_output if [ -f "$icon_icon_file" ] ; then eval 'cp "$icon_icon_file" "$icon_dir/$icon_icon_name"'$xdg_redirect_output @@ -415,7 +416,7 @@ fi done if [ -n "$kde_dir" ] ; then - mkdir -p $kde_dir + mkdir -p "$kde_dir" eval 'ln -s "$xdg_dir/$icon_name.$extension" "$kde_dir/$icon_name.$extension"'$xdg_redirect_output fi @@ -423,7 +424,8 @@ ;; uninstall) - for icon_dir in $xdg_dir $dot_icon_dir; do + for icon_dir in "$xdg_dir" "$dot_icon_dir"; do + [ -z "$icon_dir" ] && continue rm -f "$icon_dir/$icon_name.xpm" "$icon_dir/$icon_name.png" rm -f "$icon_dir/$icon_icon_name" if [ -n "$need_gnome_mime" ] ; then @@ -442,7 +444,7 @@ update_icon_database "$xdg_base_dir" if [ -n "$dot_icon_dir" ] ; then if [ -d "$dot_icon_dir/" ] && [ ! -L "$dot_icon_dir" ] ; then - update_icon_database $dot_base_dir + update_icon_database "$dot_base_dir" fi fi fi diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-mime.in xdg-utils-1.1.1/scripts/xdg-mime.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-mime.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-mime.in 2015-10-05 14:59:19.000000000 -0400 @@ -338,24 +338,23 @@ fi } -defapp_generic() +check_mimeapps_list() { - MIME="$1" - xdg_config_home="$XDG_CONFIG_HOME" - [ -n "$xdg_config_home" ] || xdg_config_home="$HOME/.config" - xdg_config_dirs="$XDG_CONFIG_DIRS" - [ -n "$xdg_config_dirs" ] || xdg_config_dirs="/etc/xdg" - xdg_user_dir="$XDG_DATA_HOME" - [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" - xdg_system_dirs="$XDG_DATA_DIRS" - [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ + local mimetype="$1" dir="$2" + local desktop oldifs="$IFS" - for x in `echo "$xdg_config_home:$xdg_config_dirs:$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do - for prefix in `echo ${XDG_CURRENT_DESKTOP} | sed 's/\(:\|$\)/- /g' | tr '[:upper:]' '[:lower:]'` ""; do - mimeapps_list="$x/applications/${prefix}mimeapps.list" - if [ -f "$mimeapps_list" ] ; then + IFS=: + for desktop in $XDG_CURRENT_DESKTOP ''; do + IFS="$oldifs" + if [ -n "$desktop" ]; then + local prefix=$(echo "$desktop-" | tr '[:upper:]' '[:lower:]') + else + local prefix= + fi + local mimeapps_list="$dir/${prefix}mimeapps.list" + if [ -f "$mimeapps_list" ] ; then DEBUG 2 "Checking $mimeapps_list" - trader_result=`awk -v mimetype="$MIME" ' + local result=$(awk -v mimetype="$mimetype" ' BEGIN { prefix=mimetype "=" indefault=0 @@ -371,13 +370,39 @@ found=1 } } -' $mimeapps_list` - if [ -n "$trader_result" ] ; then - echo $trader_result +' "$mimeapps_list") + if [ -n "$result" ]; then + echo "$result" exit_success fi - fi - done + fi + done +} + +defapp_generic() +{ + MIME="$1" + xdg_config_home="$XDG_CONFIG_HOME" + [ -n "$xdg_config_home" ] || xdg_config_home="$HOME/.config" + xdg_config_dirs="$XDG_CONFIG_DIRS" + [ -n "$xdg_config_dirs" ] || xdg_config_dirs="/etc/xdg" + xdg_user_dir="$XDG_DATA_HOME" + [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" + xdg_system_dirs="$XDG_DATA_DIRS" + [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ + + local oldifs="$IFS" dir + + IFS=: + for dir in $xdg_config_home $xdg_config_dirs; do + IFS="$oldifs" + check_mimeapps_list "$MIME" "$dir" + done + + IFS=: + for dir in $xdg_user_dir $xdg_system_dirs; do + IFS="$oldifs" + check_mimeapps_list "$MIME" "$dir/applications" done for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-open.in xdg-utils-1.1.1/scripts/xdg-open.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-open.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-open.in 2015-10-05 14:59:19.000000000 -0400 @@ -68,6 +68,35 @@ IFS="${IFS_}" } +# Returns true if argument is a file:// URL or path +is_file_url_or_path() +{ + if echo "$1" | grep -q '^file://' \ + || ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'; then + return 0 + else + return 1 + fi +} + +# If argument is a file URL, convert it to a (percent-decoded) path. +# If not, leave it as it is. +file_url_to_path() +{ + local file="$1" + if echo "$file" | grep -q '^file:///'; then + file=${file#file://} + file=${file%%#*} + file=$(echo "$file" | sed -r 's/\?.*$//') + local printf=printf + if [ -x /usr/bin/printf ]; then + printf=/usr/bin/printf + fi + file=$($printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')") + fi + echo "$file" +} + open_cygwin() { cygstart "$1" @@ -113,12 +142,29 @@ fi } -open_gnome() +open_gnome3() { - if gvfs-open --help 2>/dev/null 1>&2; then + if gvfs-open --help >/dev/null 2>&1; then gvfs-open "$1" else + open_generic "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_gnome() +{ + if gvfs-open --help >/dev/null 2>&1; then + gvfs-open "$1" + elif gnome-open --help >/dev/null 2>&1; then gnome-open "$1" + else + open_generic "$1" fi if [ $? -eq 0 ]; then @@ -270,25 +316,42 @@ fi } +open_envvar() +{ + local oldifs="$IFS" + local browser browser_with_arg + + IFS=":" + for browser in $BROWSER; do + IFS="$oldifs" + + if [ -z "$browser" ]; then + continue + fi + + if echo "$browser" | grep -q %s; then + $(printf "$browser" "$1") + else + $browser "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + fi + done +} + open_generic() { - # Paths or file:// URLs - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:'); then - - local file="$1" - - # Decode URLs - if echo "$file" | grep -q '^file:///'; then - file=${file#file://} - file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" - fi - file_check=${file%%#*} - file_check=${file_check%%\?*} - check_input_file "$file_check" + if is_file_url_or_path "$1"; then + local file="$(file_url_to_path "$1")" + + check_input_file "$file" - filetype=`xdg-mime query filetype "$file_check" | sed "s/;.*//"` - open_generic_xdg_mime "$file" "$filetype" + if [ -n "$DISPLAY" ]; then + filetype=`xdg-mime query filetype "$file" | sed "s/;.*//"` + open_generic_xdg_mime "$file" "$filetype" + fi if which run-mailcap 2>/dev/null 1>&2; then run-mailcap --action=view "$file" @@ -297,7 +360,7 @@ fi fi - if mimeopen -v 2>/dev/null 1>&2; then + if [ -n "$DISPLAY" ] && mimeopen -v 2>/dev/null 1>&2; then mimeopen -L -n "$file" if [ $? -eq 0 ]; then exit_success @@ -305,27 +368,23 @@ fi fi - open_generic_xdg_x_scheme_handler "$1" - - IFS=":" - for browser in $BROWSER; do - if [ x"$browser" != x"" ]; then - - browser_with_arg=`printf "$browser" "$1" 2>/dev/null` - if [ $? -ne 0 ]; then - browser_with_arg=$browser; - fi + if [ -n "$BROWSER" ]; then + open_envvar "$1" + fi - if [ x"$browser_with_arg" = x"$browser" ]; then - eval '$browser "$1"'$xdg_redirect_output; - else eval '$browser_with_arg'$xdg_redirect_output; - fi + if [ -n "$DISPLAY" ]; then + open_generic_xdg_x_scheme_handler "$1" + fi - if [ $? -eq 0 ]; then - exit_success; - fi + # if BROWSER variable is not set, check some well known browsers instead + if [ x"$BROWSER" = x"" ]; then + BROWSER=www-browser:links2:elinks:links:lynx:w3m + if [ -n "$DISPLAY" ]; then + BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER fi - done + fi + + open_envvar "$1" exit_failure_operation_impossible "no method available for opening '$1'" } @@ -333,18 +392,15 @@ open_lxde() { # pcmanfm only knows how to handle file:// urls and filepaths, it seems. - if (echo "$1" | grep -q '^file://' || - ! echo "$1" | egrep -q '^[[:alpha:]+\.\-]+:') - then - local file="$1" + if is_file_url_or_path "$1"; then + local file="$(file_url_to_path "$1")" # handle relative paths - if ! echo "$file" | egrep -q '^(file://)?/'; then + if ! echo "$file" | grep -q ^/; then file="$(pwd)/$file" fi pcmanfm "$file" - else open_generic "$1" fi @@ -399,20 +455,16 @@ ;; esac -# if BROWSER variable is not set, check some well known browsers instead -if [ x"$BROWSER" = x"" ]; then - BROWSER=links2:elinks:links:lynx:w3m - if [ -n "$DISPLAY" ]; then - BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER - fi -fi - case "$DE" in kde) open_kde "$url" ;; - gnome*|cinnamon) + gnome3|cinnamon) + open_gnome3 "$url" + ;; + + gnome) open_gnome "$url" ;; diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-screensaver.in xdg-utils-1.1.1/scripts/xdg-screensaver.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-screensaver.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-screensaver.in 2015-10-05 14:59:19.000000000 -0400 @@ -80,6 +80,8 @@ fi if [ "$1" = "reset" ] ; then if xset -q | grep 'DPMS is Enabled' > /dev/null 2> /dev/null; then + xset -dpms + xset +dpms xset dpms force on fi fi @@ -104,11 +106,15 @@ screensaver_xscreensaver "$1" ;; + xautolock_screensaver) + xautolock_screensaver "$1" + ;; + xfce) [ -n "$DISPLAY" ] && screensaver_xserver "$1" ;; - '') + ''|generic) [ -n "$DISPLAY" ] && screensaver_xserver "$1" ;; esac @@ -442,14 +448,54 @@ # http://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html case "$1" in suspend) - screensaver_suspend_loop \ - dbus-send --session \ - --dest=org.gnome.ScreenSaver \ - --type=method_call \ - /org/gnome/ScreenSaver \ - org.gnome.ScreenSaver.SimulateUserActivity \ - 2> /dev/null - result=$? + perl -e ' +use strict; +use warnings; +use IO::File; +use Net::DBus; +use X11::Protocol; + +my ($window_id, $screensaver_file) = @ARGV; + +# Find window name to pass to session manager. +my $x = X11::Protocol->new(); +my $named_window_id = hex($window_id); +my $window_name; +while (1) { + ($window_name) = $x->GetProperty($named_window_id, $x->atom("WM_NAME"), + $x->atom("STRING"), 0, 1000, 0); + last if defined($window_name) && $window_name ne ""; + (undef, $named_window_id) = $x->QueryTree($named_window_id); + if (!defined($named_window_id)) { + $window_name = "?"; + last; + } +} + +# 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(); +my $sm_svc = $bus->get_service("org.gnome.SessionManager"); +my $sm = $sm_svc->get_object("/org/gnome/SessionManager", + "org.gnome.SessionManager"); +$sm->Inhibit($window_name, hex($window_id), $window_name, 8); + +# Wait until removed from the status file. +while (1) { + sleep(10); + my $status = new IO::File($screensaver_file, "r") + or exit 0; + my $found; + while (<$status>) { + if (/^$window_id:/) { + $found = 1; + last; + } + } + exit 0 unless $found; +} +' $window_id $screensaver_file & + result=0 ;; resume) @@ -637,6 +683,51 @@ esac } +xautolock_screensaver() +{ + case "$1" in + suspend) + xset s off && xautolock -disable > /dev/null + result=$? + ;; + + resume) + xset s default && xautolock -enable > /dev/null + result=$? + ;; + + activate) + xautolock -enable + result=$? + ;; + + lock) + xautolock -locknow + result=$? + ;; + + reset) + xautolock -restart + result=$? + ;; + + status) + xautolock -unlocknow >/dev/null + result=$? + if [ $result -eq 0 ]; then + echo "enabled" + else + echo "disabled" + fi + ;; + + *) + echo "ERROR: Unknown command '$1" >&2 + return 1 + ;; + esac +} + [ x"$1" != x"" ] || exit_failure_syntax action= @@ -697,6 +788,8 @@ 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 "xautolock" a separate DE +xautolock -enable > /dev/null 2>&1 && DE="xautolock_screensaver" if [ "$action" = "resume" ] ; then do_resume diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-settings.in xdg-utils-1.1.1/scripts/xdg-settings.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-settings.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-settings.in 2015-10-05 14:59:19.000000000 -0400 @@ -421,7 +421,7 @@ sed -e 's/^Type=.*/Type=X-XFCE-Helper/' -e '/^Exec[=[]/,$d' "$file" > "$target/$1" echo "X-XFCE-Category=WebBrowser" >> "$target/$1" # Change %F, %f, %U, and %u to "%s". - command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | sed -e 's/%[FfUu]/"%s"/g' | head -1`" + command=$(grep -E '^Exec(\[[^]=]*])?=' "$file" | cut -d= -f 2- | sed -e 's/%[FfUu]/"%s"/g' | head -1) echo "X-XFCE-Commands=`echo "$command" | first_word`" >> "$target/$1" echo "X-XFCE-CommandsWithParameter=$command" >> "$target/$1" # Copy rest of file (from first "Exec=" line to end-of-file). @@ -463,6 +463,75 @@ } # }}} xfce +# {{{ generic + +get_browser_generic() +{ + if [ -n "$BROWSER" ]; then + local browser=$(binary_to_desktop_file "${BROWSER%%:*}") + if [ -n "$browser" ]; then + echo "$(basename "$browser")" + return 0 + fi + fi + + if get_browser_mime x-scheme-handler/http; then + return 0 + fi + + # Debian and derivatives have x-www-browser + local browser=$(binary_to_desktop_file x-www-browser) + if [ -n "$browser" ]; then + echo "$(basename "$browser")" + return 0 + fi + + return 4 +} + +check_browser_generic() +{ + local desktop="$1" + + # Check HTTP + if [ "$desktop" != "$(get_browser_generic)" ]; then + echo no + exit_success + fi + + # Check text/html + if [ "$desktop" != "$(get_browser_mime)" ]; then + echo no + exit_success + fi + + # Check HTTPS + if [ "$desktop" != "$(get_url_scheme_handler_generic https)" ]; then + echo no + exit_success + fi + + echo yes + exit_success +} + +set_browser_generic() +{ + if [ -n "$BROWSER" ]; then + exit_failure_operation_failed \ + "\$BROWSER is set and can't be changed with xdg-settings" + fi + + binary=$(desktop_file_to_binary "$1") + [ -n "$binary" ] || exit_failure_file_missing + + set_browser_mime "$1" text/html || return + + for protocol in http https about unknown; do + set_browser_mime "$1" "x-scheme-handler/$protocol" || return + done +} +# }}} generic # }}} default browser # {{{ default url scheme handler @@ -629,6 +698,53 @@ } # }}} xfce +# {{{ generic + +get_url_scheme_handler_generic() +{ + if [ -n "$BROWSER" ] && ([ "$1" = http ] || [ "$1" = https ]); then + get_browser_generic + else + get_browser_mime "x-scheme-handler/$1" + fi +} + +check_url_scheme_handler_generic() +{ + local scheme="$1" desktop="$2" + + if [ -z "$(desktop_file_to_binary "$desktop")" ]; then + echo no + exit_success + fi + + local browser=$(get_url_scheme_handler_generic "$scheme") + if [ "$browser" != "$desktop" ]; then + echo no + exit_success + fi + echo yes + exit_success +} + +set_url_scheme_handler_generic() +{ + local scheme="$1" desktop="$2" + + if [ -n "$BROWSER" ] && \ + ([ "$scheme" = http ] || [ "$scheme" = https ]); then + exit_failure_operation_failed \ + "\$BROWSER is set and can't be changed with xdg-settings" + fi + + if [ -z "$(desktop_file_to_binary "$desktop")" ]; then + exit_failure_file_missing + fi + + set_browser_mime "$desktop" "x-scheme-handler/$scheme" +} + +# }}} generic # }}} default protocol handler dispatch_specific() @@ -694,45 +810,6 @@ fi } -dispatch_generic() -{ - # We only know how to get or check the default web browser. - [ x"$op" != x"get" -a x"$op" != x"check" ] && exit_failure_operation_impossible - [ x"$parm" != x"default-web-browser" ] && exit_failure_operation_impossible - - # First look in $BROWSER - if [ x"$BROWSER" != x ]; then - binary="`which "${BROWSER%%:*}"`" - else - # Debian and Ubuntu (and others?) have x-www-browser. - binary="`which x-www-browser`" - fi - - [ "$binary" ] || exit_failure_operation_failed - - binary="`readlink -f "$binary"`" - - [ "$binary" ] || exit_failure_operation_failed - - if [ x"$op" = x"get" ]; then - desktop="`binary_to_desktop_file "$binary"`" - basename "$desktop" - else - # $op = "check" - check="`desktop_file_to_binary "$1"`" - if [ -z "$check" ]; then - echo no - exit_success - fi - if [ x"$binary" != x"$check" ]; then - echo no - exit_success - fi - echo yes - fi - exit_success -} - if [ x"$1" = x"--list" ]; then echo "Known properties:" # Extract the property names from dispatch_specific() above. @@ -754,6 +831,10 @@ detectDE +if [ -z "$DE" ]; then + DE=generic +fi + case "$DE" in kde) dispatch_specific kde "$@" @@ -772,7 +853,7 @@ ;; generic) - dispatch_generic "$@" + dispatch_specific generic "$@" ;; *) diff -Nru xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-utils-common.in xdg-utils-1.1.1/scripts/xdg-utils-common.in --- xdg-utils-1.1.0~rc3+git20150907/scripts/xdg-utils-common.in 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/scripts/xdg-utils-common.in 2015-10-05 14:59:19.000000000 -0400 @@ -279,6 +279,9 @@ XFCE) DE=xfce ;; + X-Generic) + DE=generic + ;; esac fi diff -Nru xdg-utils-1.1.0~rc3+git20150907/TODO xdg-utils-1.1.1/TODO --- xdg-utils-1.1.0~rc3+git20150907/TODO 2015-09-02 08:56:59.000000000 -0400 +++ xdg-utils-1.1.1/TODO 2015-10-05 14:59:19.000000000 -0400 @@ -8,7 +8,6 @@ xdg-screensaver * Return error when WindowID doesn't exist -* support dbus org.freedesktop.ScreenSaver methods General * Support XDG_DATA_INSTALL