1 From 21bb62e4ed715edb342bc6f1ca0983bd706228af Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Johannes=20L=C3=B6thberg?= <johannes@kyriasis.com>
3 Date: Fri, 29 May 2015 20:53:54 +0200
4 Subject: [PATCH] xdg-desktop-menu: Drop obsolete GNOME support
6 This commit drops the obsolete support for the GNOME-specific directory
7 for .desktop files, since it has not been needed since GNOME 2.10, and
8 since it forces the creation of ~/.gnome whether you want it or not.
10 https://bugs.freedesktop.org/show_bug.cgi?id=90775
12 scripts/xdg-desktop-menu.in | 47 +++++++++------------------------------------
13 1 file changed, 9 insertions(+), 38 deletions(-)
15 diff --git a/scripts/xdg-desktop-menu.in b/scripts/xdg-desktop-menu.in
16 index 13159cb..8654764 100644
17 --- a/scripts/xdg-desktop-menu.in
18 +++ b/scripts/xdg-desktop-menu.in
19 @@ -126,22 +126,18 @@ update_submenu()
20 DEBUG 3 "xdg_global_dir: $xdg_global_dir"
21 DEBUG 3 "kde_user_dir: $kde_user_dir"
22 DEBUG 3 "kde_global_dir: $kde_global_dir"
23 - DEBUG 3 "gnome_user_dir: $gnome_user_dir"
24 - DEBUG 3 "gnome_global_dir: $gnome_global_dir"
26 if [ x"$mode" = x"user" ] ; then
27 xdg_dir="$xdg_user_dir"
28 kde_dir="$kde_user_dir"
29 - gnome_dir="$gnome_user_dir"
33 xdg_dir="$xdg_global_dir"
34 kde_dir="$kde_global_dir"
35 - gnome_dir="$gnome_global_dir"
38 - if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then
39 + if [ -z "${xdg_dir}${kde_dir}" ] ; then
40 exit_failure_operation_impossible "No writable system menu directory found."
43 @@ -158,15 +154,6 @@ update_submenu()
47 - if [ $action = "install" ] && [ -f "/etc/xdg/menus/gnome-applications.menu" ] ; then
48 - # Work around for Debian Gnome
49 - gnome_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/gnome-applications-merged^'`
50 - if [ ! -e "$gnome_xdg_dir" ] ; then
51 - DEBUG 1 "Debian Workaround: Link '$xdg_dir' to '$gnome_xdg_dir'"
52 - mkdir -p `dirname "$gnome_xdg_dir"`
53 - eval 'ln -s "applications-merged" "$gnome_xdg_dir"'$xdg_redirect_output
56 if [ $action = "install" ] && [ -f "/etc/mandrake-release" ] ; then
57 # Work around for Mandriva 2006
58 mandrake_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/applications-mdk-merged^'`
59 @@ -489,20 +476,16 @@ DEBUG 3 "xdg_user_dir: $xdg_user_dir"
60 DEBUG 3 "xdg_global_dir: $xdg_global_dir"
61 DEBUG 3 "kde_user_dir: $kde_user_dir"
62 DEBUG 3 "kde_global_dir: $kde_global_dir"
63 -DEBUG 3 "gnome_user_dir: $gnome_user_dir"
64 -DEBUG 3 "gnome_global_dir: $gnome_global_dir"
66 if [ x"$mode" = x"user" ] ; then
67 xdg_dir="$xdg_user_dir"
68 kde_dir="$kde_user_dir"
69 - gnome_dir="$gnome_user_dir"
72 xdg_dir="$xdg_global_dir"
73 kde_dir="$kde_global_dir"
74 - gnome_dir="$gnome_global_dir"
76 - if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then
77 + if [ -z "${xdg_dir}${kde_dir}" ] ; then
78 exit_failure_operation_impossible "No writable system menu directory found."
81 @@ -510,14 +493,14 @@ fi
82 for desktop_file in $directory_files; do
83 basefile=`basename "$desktop_file"`
85 - DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir"
86 + DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir"
93 - for x in $xdg_dir $kde_dir $gnome_dir ; do
94 + for x in $xdg_dir $kde_dir ; do
96 eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output
98 @@ -526,7 +509,7 @@ for desktop_file in $directory_files; do
102 - for x in $xdg_dir $kde_dir $gnome_dir ; do
103 + for x in $xdg_dir $kde_dir ; do
107 @@ -555,29 +538,21 @@ kde_user_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d
108 kde_global_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 2`
109 [ -w $kde_global_dir ] || kde_global_dir=
111 -gnome_user_dir="$HOME/.gnome/apps"
112 -gnome_global_dir="/usr/share/gnome/apps"
113 -[ -w $gnome_global_dir ] || gnome_global_dir=
115 DEBUG 3 "Install locations for *.desktop files:"
116 DEBUG 3 "xdg_user_dir: $xdg_user_dir"
117 DEBUG 3 "xdg_global_dir: $xdg_global_dir"
118 DEBUG 3 "kde_user_dir: $kde_user_dir"
119 DEBUG 3 "kde_global_dir: $kde_global_dir"
120 -DEBUG 3 "gnome_user_dir: $gnome_user_dir"
121 -DEBUG 3 "gnome_global_dir: $gnome_global_dir"
123 if [ x"$mode" = x"user" ] ; then
124 xdg_dir="$xdg_user_dir"
125 kde_dir="$kde_user_dir"
126 - gnome_dir="$gnome_user_dir"
129 xdg_dir="$xdg_global_dir"
130 kde_dir="$kde_global_dir"
131 - gnome_dir="$gnome_global_dir"
133 - if [ -z "${xdg_dir}${kde_dir}${gnome_dir}" ] ; then
134 + if [ -z "${xdg_dir}${kde_dir}" ] ; then
135 exit_failure_operation_impossible "No writable system menu directory found."
138 @@ -589,14 +564,14 @@ for desktop_file in $desktop_files; do
140 basefile=`basename "$desktop_file"`
142 - DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir $gnome_dir"
143 + DEBUG 1 "$action $desktop_file in $xdg_dir $kde_dir"
150 - for x in $xdg_dir $kde_dir $gnome_dir ; do
151 + for x in $xdg_dir $kde_dir ; do
153 eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output
155 @@ -605,17 +580,13 @@ for desktop_file in $desktop_files; do
156 echo "OnlyShowIn=Old;" >> $kde_dir/$basefile
159 - if [ -f $gnome_dir/$basefile ] ; then
160 - echo "OnlyShowIn=Old;" >> $gnome_dir/$basefile
163 make_lazy_default "$xdg_dir" "$basefile"
169 - for x in $xdg_dir $kde_dir $gnome_dir ; do
170 + for x in $xdg_dir $kde_dir ; do