summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2020-03-12 12:32:06 +0000
committerLuca Boccassi <luca.boccassi@microsoft.com>2020-03-12 12:32:26 +0000
commit015e6b65f3173e16d7ee4c3d9fa407d7ed1c9c45 (patch)
tree7542fe60f3e17e8c944371a3922683998429d6d4 /functions
parentc2e73627dba7e421db409a9c1854598edaef65f1 (diff)
downloadvyos-live-build-015e6b65f3173e16d7ee4c3d9fa407d7ed1c9c45.tar.gz
vyos-live-build-015e6b65f3173e16d7ee4c3d9fa407d7ed1c9c45.zip
Revert "Test for executables: replace 'which' with more robust 'command -v'"
This reverts commit 2d9ab1f7f82f9a98b97d1503c1e3f31c86061c15. Causes test failure due to bashism.
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/architectures.sh2
-rwxr-xr-xfunctions/defaults.sh6
-rwxr-xr-xfunctions/losetup.sh2
-rwxr-xr-xfunctions/man.sh2
-rwxr-xr-xfunctions/packages.sh2
5 files changed, 7 insertions, 7 deletions
diff --git a/functions/architectures.sh b/functions/architectures.sh
index bdad4cbc0..aeb298eb3 100755
--- a/functions/architectures.sh
+++ b/functions/architectures.sh
@@ -50,7 +50,7 @@ Check_architectures ()
Check_crossarchitectures ()
{
- if command -v dpkg >/dev/null
+ if [ $(which dpkg) ]
then
HOST="$(dpkg --print-architecture)"
else
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 14dd5d269..695195d9d 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -14,7 +14,7 @@ New_configuration ()
## Runtime
# Image: Architecture
- if command -v dpkg >/dev/null
+ if [ $(which dpkg) ]
then
CURRENT_IMAGE_ARCHITECTURE="$(dpkg --print-architecture)"
else
@@ -94,7 +94,7 @@ Set_config_defaults ()
LB_SYSTEM="${LB_SYSTEM:-live}"
# Setting mode (currently: debian, progress-linux)
- if command -v lsb_release >/dev/null
+ if [ $(which lsb_release) ]
then
_DISTRIBUTOR="$(lsb_release -is | tr "[A-Z]" "[a-z]")"
@@ -802,7 +802,7 @@ Check_config_defaults ()
{
case "${LB_BINARY_FILESYSTEM}" in
ntfs)
- if ! command -v ntfs-3g >/dev/null
+ if [ ! $(which ntfs-3g) ]
then
Echo_error "Using ntfs as the binary filesystem is currently only supported if ntfs-3g is installed on the host system."
diff --git a/functions/losetup.sh b/functions/losetup.sh
index 971054284..c3dd59641 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 command -v udevadm >/dev/null
+ if [ $(which udevadm) ]
then
udevadm settle
fi
diff --git a/functions/man.sh b/functions/man.sh
index 9eeb7206f..cb886fba1 100755
--- a/functions/man.sh
+++ b/functions/man.sh
@@ -11,7 +11,7 @@
Man ()
{
- if command -v man >/dev/null
+ if [ $(which man) ]
then
man $(basename ${0})
exit 0
diff --git a/functions/packages.sh b/functions/packages.sh
index edf6f87b2..f07bed35f 100755
--- a/functions/packages.sh
+++ b/functions/packages.sh
@@ -81,7 +81,7 @@ Check_installed ()
INSTALL_STATUS=1
fi
else
- if command -v dpkg-query >/dev/null
+ if [ $(which dpkg-query) ]
then
if dpkg-query -s "${PACKAGE}" 2> /dev/null | grep -qs "Status: install"
then