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

Side by Side Diff: scripts/xdg-icon-resource

Issue 6873103: Linux: update xdg-utils to the latest version to get relevant xdg-mime fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/xdg-utils/
Patch Set: Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/xdg-email.in ('k') | scripts/xdg-mime » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/sh 1 #!/bin/sh
2 #--------------------------------------------- 2 #---------------------------------------------
3 # xdg-icon-resource 3 # xdg-icon-resource
4 # 4 #
5 # Utility script to install icons on a Linux desktop. 5 # Utility script to install icons on a Linux desktop.
6 # 6 #
7 # Refer to the usage() function below for usage. 7 # Refer to the usage() function below for usage.
8 # 8 #
9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org> 9 # Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org> 10 # Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 # All output to stderr 389 # All output to stderr
390 xdg_redirect_output=" >&2" 390 xdg_redirect_output=" >&2"
391 fi 391 fi
392 392
393 #-------------------------------------- 393 #--------------------------------------
394 # Checks for known desktop environments 394 # Checks for known desktop environments
395 # set variable DE to the desktop environments name, lowercase 395 # set variable DE to the desktop environments name, lowercase
396 396
397 detectDE() 397 detectDE()
398 { 398 {
399 # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
400 unset GREP_OPTIONS
401
399 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; 402 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
400 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; 403 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
401 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/D Bus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/nul l 2>&1` ; then DE=gnome; 404 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/D Bus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/nul l 2>&1` ; then DE=gnome;
402 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce; 405 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/nul l 2>&1; then DE=xfce;
406 elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2> &1; then DE=xfce
403 fi 407 fi
404 408
405 if [ x"$DE" = x"" ]; then 409 if [ x"$DE" = x"" ]; then
406 # fallback to checking $DESKTOP_SESSION 410 # fallback to checking $DESKTOP_SESSION
407 case "$DESKTOP_SESSION" in 411 case "$DESKTOP_SESSION" in
412 gnome)
413 DE=gnome;
408 LXDE) 414 LXDE)
409 DE=lxde; 415 DE=lxde;
410 ;; 416 ;;
411 xfce|xfce4) 417 xfce|xfce4)
412 DE=xfce; 418 DE=xfce;
413 ;; 419 ;;
414 esac 420 esac
415 fi 421 fi
416 422
417 if [ x"$DE" = x"" ]; then 423 if [ x"$DE" = x"" ]; then
(...skipping 12 matching lines...) Expand all
430 fi 436 fi
431 } 437 }
432 438
433 #---------------------------------------------------------------------------- 439 #----------------------------------------------------------------------------
434 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 440 # kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4
435 # It also always returns 1 in KDE 3.4 and earlier 441 # It also always returns 1 in KDE 3.4 and earlier
436 # Simply return 0 in such case 442 # Simply return 0 in such case
437 443
438 kfmclient_fix_exit_code() 444 kfmclient_fix_exit_code()
439 { 445 {
440 [ x"$KDE_SESSION_VERSION" = x"4" ] && return 0;
441 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'` 446 version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
442 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` 447 major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
443 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` 448 minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
444 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` 449 release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
445 test "$major" -gt 3 && return $1 450 test "$major" -gt 3 && return $1
446 test "$minor" -gt 5 && return $1 451 test "$minor" -gt 5 && return $1
447 test "$release" -gt 4 && return $1 452 test "$release" -gt 4 && return $1
448 return 0 453 return 0
449 } 454 }
450 455
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 if [ x"$update" = x"yes" ] ; then 865 if [ x"$update" = x"yes" ] ; then
861 update_icon_database "$xdg_base_dir" 866 update_icon_database "$xdg_base_dir"
862 if [ -n "$dot_icon_dir" ] ; then 867 if [ -n "$dot_icon_dir" ] ; then
863 if [ -d "$dot_icon_dir/" -a ! -L "$dot_icon_dir" ] ; then 868 if [ -d "$dot_icon_dir/" -a ! -L "$dot_icon_dir" ] ; then
864 update_icon_database $dot_base_dir 869 update_icon_database $dot_base_dir
865 fi 870 fi
866 fi 871 fi
867 fi 872 fi
868 873
869 exit_success 874 exit_success
OLDNEW
« no previous file with comments | « scripts/xdg-email.in ('k') | scripts/xdg-mime » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698