install-config-file: Actually use the found binary
@@ -26,11 +26,11 @@ fi
# different binaries are installed depending on the build options
if command -v kdb ; then
- binary=$(command -v kdb)
+ kdbBinary=$(command -v kdb)
elif command -v kdb-static ; then
- binary=$(command -v kdb-static)
+ kdbBinary=$(command -v kdb-static)
elif command -v kdb-full ; then
- binary=$(command -v kdb-full)
+ kdbBinary=$(command -v kdb-full)
else
echo "ERROR: Could not find a kdb binary."
exit 29
@@ -45,23 +45,23 @@ fi
base="${specialPathStart}${specialPathEnd}"
# check if something is in <elektra path>
-contentOfElektraPath=$(kdb ls $our)
+contentOfElektraPath=$($kdbBinary ls $our)
if [ $? -ne 0 ]; then
echo "ERROR: Could not use kdb ls on $our." >&2
exit 30
fi
if [ -z "$contentOfElektraPath" ]; then
- kdb mount --with-recommends $their $our $format
+ $kdbBinary mount --with-recommends $their $our $format
if ! [ $? -eq 0 ]; then
echo "Could not mount file $their." >&2
exit 31
fi
- resolvedLocation=$(kdb file $our)
+ resolvedLocation=$($kdb file $our)
if ! [ -f $resolvedLocation ]; then
echo "Could not import file $resolvedLocation as it does not exist!" >&2
exit 32
fi
- cat $resolvedLocation | kdb import $base $format
+ cat $resolvedLocation | $kdbBinary import $base $format
if ! [ $? -eq 0 ]; then
echo "Could not import file from $resolvedLocation to $base." >&2
exit 33
@@ -71,17 +71,17 @@ else
# however, mounting a second time gives a more consistent user experience
# as like this the resolver is used for <config file> each time the script
# is called
- kdb mount -q --with-recommends $their $tempPath $format
+ $kdbBinary mount -q --with-recommends $their $tempPath $format
if ! [ $? -eq 0 ]; then
echo "Could not mount file $their. Got code $?" >&2
exit 34
fi
- kdb cmerge -f $our $tempPath $base $our $format
+ $kdbBinary cmerge -f $our $tempPath $base $our $format
if ! [ $? -eq 0 ]; then
echo "Merging $our, $tempPath and $base into $our failed." >&2
exit 35
fi
- kdb umount $tempPath
+ $kdbBinary umount $tempPath
if ! [ $? -eq 0 ]; then
echo "umount $tempPath failed." >&2
exit 36
