From d9b892a73f2f078ae6314c4925b438e43fe4392e Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Fri, 16 Oct 2009 10:49:31 -0600 Subject: [PATCH] Use both devkit-disks and hal-lock if available During the transition period from HAL to devicekit-disks some distributions might require both methods to prevent device auto-mounting. See Ubuntu launchpad bug link: https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/428133 --- gparted.in | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gparted.in b/gparted.in index fe22f5a3..e6c1473a 100755 --- a/gparted.in +++ b/gparted.in @@ -37,15 +37,22 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do done # -# Use devkit-disks for invocation if binary exists and daemon is running. +# 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. # Otherwise use hal-lock for invocation if binary exists and daemon is running. # If the above checks fail then simply run gpartedbin. # -if test "x$HAVE_DEVKIT_DISKS" = "xyes"; then - devkit-disks --inhibit -- @installdir@/gpartedbin $* +BASE_CMD="@installdir@/gpartedbin $*" +if 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" +elif test "x$HAVE_DEVKIT_DISKS" = "xyes"; then + devkit-disks --inhibit -- $BASE_CMD elif test "x$HAVE_HAL_LOCK" = "xyes"; then hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \ - --run "@installdir@/gpartedbin $*" + --run "$BASE_CMD" else - @installdir@/gpartedbin $* + $BASE_CMD fi