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
This commit is contained in:
Curtis Gedak 2010-06-01 17:04:39 -06:00
parent c90412255a
commit 4168794e8e
1 changed files with 21 additions and 3 deletions

24
gparted.in Executable file → Normal file
View File

@ -8,9 +8,24 @@
# prior to the completion of GParted's operations. # 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 # Search PATH to determine if devkit-disks program can be found
# and if appropriate daemon is running. # and if appropriate daemon is running.
# On December 1, 2009, devkit-disks was named udisks.
# #
HAVE_DEVKIT_DISKS=no HAVE_DEVKIT_DISKS=no
for k in '' `echo "$PATH" | sed 's,:, ,g'`; do for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
@ -37,14 +52,17 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
done 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. # 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. # 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.
# #
BASE_CMD="@installdir@/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 -- \ devkit-disks --inhibit -- \
hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \ hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
--run "$BASE_CMD" --run "$BASE_CMD"