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:
parent
c90412255a
commit
4168794e8e
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue