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
This commit is contained in:
Curtis Gedak 2009-10-16 10:49:31 -06:00
parent 4fea82af2e
commit d9b892a73f

View file

@ -37,15 +37,22 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
done 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. # Otherwise use hal-lock for invocation if binary exists and daemon is running.
# If the above checks fail then simply run gpartedbin. # If the above checks fail then simply run gpartedbin.
# #
if test "x$HAVE_DEVKIT_DISKS" = "xyes"; then BASE_CMD="@installdir@/gpartedbin $*"
devkit-disks --inhibit -- @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 elif test "x$HAVE_HAL_LOCK" = "xyes"; then
hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \ hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
--run "@installdir@/gpartedbin $*" --run "$BASE_CMD"
else else
@installdir@/gpartedbin $* $BASE_CMD
fi fi