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

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

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
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-copy.in ('k') | third_party/xdg-utils/scripts/xdg-desktop-icon.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/xdg-utils/scripts/xdg-desktop-icon
===================================================================
--- third_party/xdg-utils/scripts/xdg-desktop-icon (revision 57942)
+++ third_party/xdg-utils/scripts/xdg-desktop-icon (working copy)
@@ -301,7 +301,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()
{
@@ -378,7 +378,7 @@
;;
--version)
- echo "xdg-desktop-icon 1.0.1"
+ echo "xdg-desktop-icon 1.0.2"
exit_success
;;
esac
@@ -404,7 +404,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
}
@@ -425,7 +426,7 @@
return 0
}
-[ x"$1" != x"" ] || exit_failure_syntax
+[ x"$1" != x"" ] || exit_failure_syntax
action=
desktop_file=
@@ -482,7 +483,7 @@
fi
filetype=
-case $desktop_file in
+case "$desktop_file" in
*.desktop)
filetype=desktop
if [ "$vendor" = "true" -a "$action" = "install" ] ; then
@@ -495,52 +496,56 @@
esac
my_umask=077
-desktop_dir="$HOME/Desktop"
+if xdg-user-dir 2>/dev/null 1>&2; then
+ desktop_dir=`xdg-user-dir DESKTOP`
+fi
desktop_dir_kde=`kde${KDE_SESSION_VERSION}-config --userpath desktop 2> /dev/null`
if gconftool-2 -g /apps/nautilus/preferences/desktop_is_home_dir 2> /dev/null | grep true > /dev/null; then
desktop_dir_gnome="$HOME"
# Don't create $HOME/Desktop if it doesn't exist
- [ -w $desktop_dir ] || desktop_dir=
+ [ -w "$desktop_dir" ] || desktop_dir=
fi
if [ -n "$desktop_dir_kde" ]; then
if [ ! -d "$desktop_dir_kde" ]; then
save_umask=`umask`
umask $my_umask
- mkdir -p $desktop_dir_kde
+ mkdir -p "$desktop_dir_kde"
umask $save_umask
fi
# Is the KDE desktop dir != $HOME/Desktop ?
if [ x`readlink -f "$desktop_dir"` != x`readlink -f "$desktop_dir_kde"` ]; then
# If so, don't create $HOME/Desktop if it doesn't exist
- [ -w $desktop_dir ] || desktop_dir=
+ [ -w "$desktop_dir" ] || desktop_dir=
else
desktop_dir_kde=
fi
fi
-desktop_dir="$desktop_dir $desktop_dir_kde $desktop_dir_gnome"
basefile=`basename "$desktop_file"`
-DEBUG 1 "$action $desktop_file in $desktop_dir"
+DEBUG 1 "$action $desktop_file in $desktop_dir $desktop_dir_kde $desktop_dir_gnome"
case $action in
install)
save_umask=`umask`
umask $my_umask
- for x in $desktop_dir ; do
- mkdir -p $x
- eval 'cp $desktop_file $x/$basefile'$xdg_redirect_output
+ for x in "$desktop_dir" "$desktop_dir_kde" "$desktop_dir_gnome" ; do
+ if [ -n "$x" ]; then
+ mkdir -p "$x"
+ eval 'cp "$desktop_file" "$x/$basefile"'$xdg_redirect_output
+ fi
done
umask $save_umask
;;
uninstall)
- for x in $desktop_dir ; do
- rm -f $x/$basefile
+ for x in "$desktop_dir" "$desktop_dir_kde" "$desktop_dir_gnome" ; do
+ if [ -n "$x" ]; then
+ rm -f "$x/$basefile"
+ fi
done
-
;;
esac
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-copy.in ('k') | third_party/xdg-utils/scripts/xdg-desktop-icon.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698