From 2d9ab1f7f82f9a98b97d1503c1e3f31c86061c15 Mon Sep 17 00:00:00 2001 From: johnraff Date: Thu, 12 Mar 2020 14:37:21 +0900 Subject: Test for executables: replace 'which' with more robust 'command -v' Instances of: if [ $(which ] have been replaced with: if command -v >/dev/null which is considered to be more robust in a range of environments. scripts/build/chroot_archives: line 259: if [ "${LB_APT}" = "aptitude" ] && [ ! $(Chroot chroot "which aptitude") ] has been left untouched because the chroot might require a more complex command which would need more testing. manpages/Makefile: line 42: @if [ ! -x "$$(which po4a 2>/dev/null)" ]; \ has been left untouched because I am not sufficiently familiar with makefiles. --- share/hooks/normal/0400-update-apt-file-cache.hook.chroot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/hooks/normal/0400-update-apt-file-cache.hook.chroot') diff --git a/share/hooks/normal/0400-update-apt-file-cache.hook.chroot b/share/hooks/normal/0400-update-apt-file-cache.hook.chroot index 4634d4cf8..c83225fe5 100755 --- a/share/hooks/normal/0400-update-apt-file-cache.hook.chroot +++ b/share/hooks/normal/0400-update-apt-file-cache.hook.chroot @@ -8,7 +8,7 @@ set -e . /live-build/config/binary -if [ $(which apt-file) ] && [ "${LB_APT_INDICES}" = "true" ] +if command -v apt-file >/dev/null && [ "${LB_APT_INDICES}" = "true" ] then apt-file update fi -- cgit v1.2.3