From 4168794e8e80d2d6457d87f33983cee2d836f527 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Tue, 1 Jun 2010 17:04:39 -0600 Subject: [PATCH] Handle devkit-disks being renamed to udisks on Dec. 1, 2009. Reference link for devkit-disks being renamed to udisks: http://www.freedesktop.org/wiki/Software/DeviceKit-disks --- gparted.in | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) mode change 100755 => 100644 gparted.in diff --git a/gparted.in b/gparted.in old mode 100755 new mode 100644 index e6c1473a..3a2696d7 --- a/gparted.in +++ b/gparted.in @@ -8,9 +8,24 @@ # prior to the completion of GParted's operations. # +# +# Search PATH to determine if udisks program can be found +# and if appropriate daemon is running. +# +HAVE_UDISKS=no +for k in '' `echo "$PATH" | sed 's,:, ,g'`; do + if test -x "$k/udisks"; then + if test "z`ps -e | grep udisks-daemon`" != "z"; then + HAVE_UDISKS=yes + break + fi + fi +done + # # Search PATH to determine if devkit-disks program can be found # and if appropriate daemon is running. +# On December 1, 2009, devkit-disks was named udisks. # HAVE_DEVKIT_DISKS=no for k in '' `echo "$PATH" | sed 's,:, ,g'`; do @@ -37,14 +52,17 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do done # -# Use both devkit-disks and hal-lock for invocation if both binaries exist +# Use udisks if binary exists and daemon is running. +# Else use both devkit-disks and hal-lock for invocation if both binaries exist # and both of the daemons are running. -# Else use devkit-disks for invocation if binary exists and daemon is running. +# Else use devkit-disks if binary exists and daemon is running. # Otherwise use hal-lock for invocation if binary exists and daemon is running. # If the above checks fail then simply run gpartedbin. # BASE_CMD="@installdir@/gpartedbin $*" -if test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then +if test "x$HAVE_UDISKS" = "xyes"; then + udisks --inhibit -- $BASE_CMD +elif test "x$HAVE_DEVKIT_DISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then devkit-disks --inhibit -- \ hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \ --run "$BASE_CMD"