summaryrefslogtreecommitdiff
path: root/functions/losetup.sh
diff options
context:
space:
mode:
authorjohnraff <github@rafflesnagoya.com>2020-05-01 11:23:39 +0900
committerRaphaƫl Hertzog <hertzog@debian.org>2020-05-01 09:59:11 +0000
commit0e5d0483e5596e200430d28356b808af76806439 (patch)
tree66ea8d81afc59322bedce8c738f32fa737877bd1 /functions/losetup.sh
parentfd18d46e0eb6abfe757f8764c65ac4c472fcdeef (diff)
downloadvyos-live-build-0e5d0483e5596e200430d28356b808af76806439.tar.gz
vyos-live-build-0e5d0483e5596e200430d28356b808af76806439.zip
Replace 'which' with 'command -v' to test for the existance of an executable
This is considered to be more robust. Two instances remain: scripts/build/chroot_archives, line 257: if [ "${LB_APT}" = "aptitude" ] && [ ! $(Chroot chroot "which aptitude") ] The command is run inside a chroot where the environment might be special, and would need further testing. manpages/Makefile, line 42: @if [ ! -x "$$(which po4a 2>/dev/null)" ]; \ I am insufficiently familiar with makefile syntax to edit this.
Diffstat (limited to 'functions/losetup.sh')
-rwxr-xr-xfunctions/losetup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/functions/losetup.sh b/functions/losetup.sh
index c91852f26..6774646ff 100755
--- a/functions/losetup.sh
+++ b/functions/losetup.sh
@@ -22,7 +22,7 @@ Lodetach ()
# Changes to block devices result in uevents which trigger rules which in
# turn access the loop device (ex. udisks-part-id, blkid) which can cause
# a race condition. We call 'udevadm settle' to help avoid this.
- if [ $(which udevadm) ]
+ if command -v udevadm >/dev/null
then
udevadm settle
fi