From 88204bfa82f982a986d2aa3e166a4c5946040308 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Thu, 25 Nov 2021 02:12:58 +0100 Subject: treewide: drop use of which Ubuntu started to flag which as deprecated and it seems which is not really standard and may vary across Distro. Drop the use of which and use the standard 'command -v' for this simple task. Which is still present in the prereq if some package/script still use which. A utility script called command_all.sh is implemented that will just mimic the output of which -a. Signed-off-by: Ansuel Smith --- include/prereq.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/prereq.mk') diff --git a/include/prereq.mk b/include/prereq.mk index 23d5ded9b2..0033535e78 100644 --- a/include/prereq.mk +++ b/include/prereq.mk @@ -49,7 +49,7 @@ endef define RequireCommand define Require/$(1) - which $(1) + command -v $(1) endef $$(eval $$(call Require,$(1),$(2))) @@ -103,7 +103,7 @@ define SetupHostCommand $(call QuoteHostCommand,$(11)) $(call QuoteHostCommand,$(12)); do \ if [ -n "$$$$$$$$cmd" ]; then \ bin="$$$$$$$$(PATH="$(subst $(space),:,$(filter-out $(STAGING_DIR_HOST)/%,$(subst :,$(space),$(PATH))))" \ - which "$$$$$$$${cmd%% *}")"; \ + command -v "$$$$$$$${cmd%% *}")"; \ if [ -x "$$$$$$$$bin" ] && eval "$$$$$$$$cmd" >/dev/null 2>/dev/null; then \ mkdir -p "$(STAGING_DIR_HOST)/bin"; \ ln -sf "$$$$$$$$bin" "$(STAGING_DIR_HOST)/bin/$(strip $(1))"; \ -- cgit v1.2.3