mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-08-28 04:00:24 +00:00
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:
parent
4fea82af2e
commit
d9b892a73f
17
gparted.in
17
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
|
||||
|
|
Loading…
Reference in a new issue