[gparted] Handle devkit-disks being renamed to udisks on Dec. 1, 2009.



commit 4168794e8e80d2d6457d87f33983cee2d836f527
Author: Curtis Gedak <gedakc gmail com>
Date:   Tue Jun 1 17:04:39 2010 -0600

    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 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/gparted.in b/gparted.in
old mode 100755
new mode 100644
index e6c1473..3a2696d
--- a/gparted.in
+++ b/gparted.in
@@ -9,8 +9,23 @@
 #
 
 #
+#  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"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]