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

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

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-desktop-icon ('k') | third_party/xdg-utils/scripts/xdg-desktop-menu » ('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.in
===================================================================
--- third_party/xdg-utils/scripts/xdg-desktop-icon.in (revision 57942)
+++ third_party/xdg-utils/scripts/xdg-desktop-icon.in (working copy)
@@ -27,7 +27,7 @@
#@xdg-utils-common@
-[ x"$1" != x"" ] || exit_failure_syntax
+[ x"$1" != x"" ] || exit_failure_syntax
action=
desktop_file=
@@ -84,7 +84,7 @@
fi
filetype=
-case $desktop_file in
+case "$desktop_file" in
*.desktop)
filetype=desktop
if [ "$vendor" = "true" -a "$action" = "install" ] ; then
@@ -98,49 +98,55 @@
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
;;
« no previous file with comments | « third_party/xdg-utils/scripts/xdg-desktop-icon ('k') | third_party/xdg-utils/scripts/xdg-desktop-menu » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698