From 325c6eb2475e1edc2d2a366b4f306f3713efb8d3 Mon Sep 17 00:00:00 2001 From: Curtis Gedak Date: Sat, 29 May 2021 10:25:48 -0600 Subject: [PATCH] Handle change in path for udisks2-inhibit executable (!84) Debian (and derived) distros with the udisks2 [1] repository and the additional 'udisks2-inhibit' executable had the location changed from: /usr/lib/udisks2/ to: /usr/libexec/udisks2/ with udisks2 version 2.8.4-2 and the following commit: f6744a33 - Move the daemons to /usr/libexec now that's allowed in the policy https://salsa.debian.org/utopia-team/udisks2/-/commit/f6744a3364eafdb07e3e78e329f202394804c574 Distros such as Fedora and openSUSE are unaffected as the udisks [2] repository does not contain 'udisks2-inhibit'. [1] udisks2 Debian (and derived) repository https://salsa.debian.org/utopia-team/udisks2 [2] udisks repository https://github.com/storaged-project/udisks Closes !84 - Handle change in path for udisks2-inhibit executable --- gparted.in | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gparted.in b/gparted.in index 185a73f2..f446d150 100755 --- a/gparted.in +++ b/gparted.in @@ -102,15 +102,20 @@ for k in '' `echo "$PATH" | sed 's,:, ,g'`; do done # -# Check if udisks2-inhibit exists in known location +# Check if udisks2-inhibit exists in a known location # and if appropriate daemon is running. # HAVE_UDISKS2_INHIBIT=no -if test -x "/usr/lib/udisks2/udisks2-inhibit"; then - if pidof udisksd 1> /dev/null; then - HAVE_UDISKS2_INHIBIT=yes +for k in /usr/libexec/udisks2/udisks2-inhibit \ + /usr/lib/udisks2/udisks2-inhibit; do + if test -x $k; then + if pidof udisksd 1> /dev/null; then + HAVE_UDISKS2_INHIBIT=yes + UDISKS2_INHIBIT_BIN=$k + break + fi fi -fi +done # # Search PATH to determine if udisks program can be found @@ -206,7 +211,7 @@ done # If the above checks fail then simply run gpartedbin. # if test "x$HAVE_UDISKS2_INHIBIT" = "xyes"; then - /usr/lib/udisks2/udisks2-inhibit $BASE_CMD + $UDISKS2_INHIBIT_BIN $BASE_CMD elif test "x$HAVE_UDISKS" = "xyes" && test "x$HAVE_HAL_LOCK" = "xyes"; then udisks --inhibit -- \ hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \