Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2854)

Unified Diff: third_party/xdg-utils/scripts/xdg-desktop-menu

Issue 3273010: Update our copy of xdg-utils to 2010-08-30, and include a patched xdg-mime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/xdg-utils/scripts/xdg-desktop-menu
===================================================================
--- third_party/xdg-utils/scripts/xdg-desktop-menu (revision 57942)
+++ third_party/xdg-utils/scripts/xdg-desktop-menu (working copy)
@@ -497,7 +497,7 @@
}
#------------------------------------------------------------
-# Exit script on insufficient permission to read a specified file
+# Exit script on insufficient permission to write a specified file
exit_failure_file_permission_write()
{
@@ -574,7 +574,7 @@
;;
--version)
- echo "xdg-desktop-menu 1.0.1"
+ echo "xdg-desktop-menu 1.0.2"
exit_success
;;
esac
@@ -600,7 +600,8 @@
{
if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
- elif xprop -root _DT_SAVE_MODE | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
+ elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
+ elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
fi
}
@@ -635,42 +636,6 @@
fi
}
-fixup_mandriva_categories()
-{
- DEBUG 1 "fixup_mandriva_categories $1"
- awk '
-BEGIN {
- xlat["AudioVideo"]="X-Mandrakelinux-Multimedia;X-MandrivaLinux-Multimedia"
- xlat["Development"]="X-Mandrakelinux-MoreApplications-Development;X-MandrivaLinux-MoreApplications-Development"
- xlat["Education"]="X-Mandrakelinux-MoreApplications;X-MandrivaLinux-MoreApplications-Education"
- xlat["Game"]="X-Mandrakelinux-MoreApplications;X-MandrivaLinux-MoreApplications-Games"
- xlat["Graphics"]="X-Mandrakelinux-Multimedia-Graphics"
- xlat["Network"]="X-Mandrakelinux-Internet;X-MandrivaLinux-Internet"
- xlat["Office"]="X-Mandrakelinux-Office;X-MandrivaLinux-Office"
- xlat["System"]="X-Mandrakelinux-System;X-MandrivaLinux-System"
- xlat["Utility"]="X-Mandrakelinux-Office-Accessories;X-MandrivaLinux-Office-Accessories"
-}
-{
- if (match($0,/Categories=/)) {
- split(substr($0,RSTART+11),categories,";")
- result=""
- for (n in categories)
- {
- if (categories[n] in xlat)
- categories[n]=categories[n] ";" xlat[categories[n]]
- if (categories[n])
- result=result categories[n] ";"
- }
- print "Categories=" result
- }
- else
- {
- print $0
- }
-}' $1 > $1.new
- mv $1.new $1
-}
-
# Make application $1/$2 the default for all the mimetypes it support,
# iff such mimetype didn't had a default application already.
# $1 Install dir for desktop file
@@ -680,7 +645,7 @@
local mimetypes
local xdg_user_dir
local xdg_default_dirs
-
+
DEBUG 1 "make_lazy_default $1/$2"
mimetypes=`awk '
{
@@ -693,7 +658,7 @@
}
}
}' "$1/$2" 2> /dev/null`
-
+
for MIME in $mimetypes ; do
xdg_default_dirs="$XDG_DATA_DIRS"
[ -n "$xdg_default_dirs" ] || xdg_default_dirs=/usr/local/share/:/usr/share/
@@ -750,7 +715,7 @@
xdg_user_dir="$xdg_user_dir/applications-merged"
xdg_global_dir="$xdg_global_dir/applications-merged"
- DEBUG 3 "Install locations for *.menu file:"
+ DEBUG 3 "Install locations for *.menu file:"
DEBUG 3 "xdg_user_dir: $xdg_user_dir"
DEBUG 3 "xdg_global_dir: $xdg_global_dir"
DEBUG 3 "kde_user_dir: $kde_user_dir"
@@ -813,7 +778,7 @@
mkdir -p `dirname "$kde_xdg_dir"`
eval 'ln -s "applications-merged" "$kde_xdg_dir"'$xdg_redirect_output
fi
- fi
+ fi
if [ $action = "install" -a x"$mode" = x"system" -a -d "/etc/xdg/menus/kde-applications-merged" -a ! -d "/etc/xdg/menus/applications-merged" ] ; then
# Work around for Kubuntu 6.06
kde_xdg_dir=`echo "$xdg_dir" | sed -e 's^/applications-merged^/kde-applications-merged^'`
@@ -868,9 +833,9 @@
done
fi
rm -f "$tmpfile"
-
+
DEBUG 3 "Files to list in $menu_file: $new_desktop_files"
-
+
if [ -n "$new_desktop_files" ] ; then
# Install/update
test "${TMPDIR+set}" = set || TMPDIR=/tmp
@@ -900,10 +865,10 @@
echo "</Menu>"
done
- echo '</Menu>'
+ echo '</Menu>'
) > $tmpfile
chmod $my_chmod $tmpfile
-
+
save_umask=`umask`
umask $my_umask
@@ -916,7 +881,7 @@
# Uninstall
rm -f $xdg_dir/$menu_file
fi
-
+
# Uninstall .directory files only if no longer referenced
if [ $action = "uninstall" ] ; then
test "${TMPDIR+set}" = set || TMPDIR=/tmp
@@ -934,7 +899,7 @@
}
}' $menu_file >> $tmpfile
fi
- done
+ done
orig_directory_files="$directory_files"
directory_files=
for desktop_file in $orig_directory_files; do
@@ -998,7 +963,7 @@
system)
mode="system"
;;
-
+
*)
exit_failure_syntax "unknown mode '$1'"
;;
@@ -1111,7 +1076,7 @@
fi
done
-DEBUG 3 "Install locations for *.directory files:"
+DEBUG 3 "Install locations for *.directory files:"
DEBUG 3 "xdg_user_dir: $xdg_user_dir"
DEBUG 3 "xdg_global_dir: $xdg_global_dir"
DEBUG 3 "kde_user_dir: $kde_user_dir"
@@ -1178,18 +1143,15 @@
fi
done
-kde_user_dir="$HOME/.kde/share/applnk"
-kde_global_dir="/usr/share/applnk"
+kde_user_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 1`
+kde_global_dir=`kde${KDE_SESSION_VERSION}-config --path apps 2> /dev/null | cut -d ':' -f 2`
[ -w $kde_global_dir ] || kde_global_dir=
gnome_user_dir="$HOME/.gnome/apps"
gnome_global_dir="/usr/share/gnome/apps"
[ -w $gnome_global_dir ] || gnome_global_dir=
-[ -f /etc/mandriva-release ] && need_mandriva_fix=true
-[ -n "$need_mandriva_fix" ] && DEBUG 1 "Fixing up .desktop categories (Mandriva work around)"
-
-DEBUG 3 "Install locations for *.desktop files:"
+DEBUG 3 "Install locations for *.desktop files:"
DEBUG 3 "xdg_user_dir: $xdg_user_dir"
DEBUG 3 "xdg_global_dir: $xdg_global_dir"
DEBUG 3 "kde_user_dir: $kde_user_dir"
@@ -1231,10 +1193,6 @@
eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output
done
- if [ -n "$need_mandriva_fix" ] ; then
- fixup_mandriva_categories $xdg_dir/$basefile
- fi
-
if [ -f $kde_dir/$basefile ] ; then
echo "OnlyShowIn=Old;" >> $kde_dir/$basefile
fi
@@ -1242,7 +1200,7 @@
if [ -f $gnome_dir/$basefile ] ; then
echo "OnlyShowIn=Old;" >> $gnome_dir/$basefile
fi
-
+
make_lazy_default "$xdg_dir" "$basefile"
umask $save_umask
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-desktop-icon.in ('k') | third_party/xdg-utils/scripts/xdg-desktop-menu.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698