mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
regression: replace command -v with which in Makefile
The command shell builtin is not recognized by older versions of make, so switch back to using the which binary instead. Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
parent
765d5b87ef
commit
52fc40a9cb
@ -35,7 +35,7 @@ VERSION=$(shell cat $(COMMONDIR)/Version)
|
|||||||
pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))
|
pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))
|
||||||
map = $(foreach a,$(2),$(call $(1),$(a)))
|
map = $(foreach a,$(2),$(call $(1),$(a)))
|
||||||
|
|
||||||
AWK?=$(or $(shell command -v awk),$(error awk utility required for build but not available))
|
AWK?=$(or $(shell which awk),$(error awk utility required for build but not available))
|
||||||
|
|
||||||
define nl
|
define nl
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ manually, or build against in-tree libapparmor.${nl}\
|
|||||||
endif # LIBAPPARMOR not set
|
endif # LIBAPPARMOR not set
|
||||||
LDLIBS += $(LIBAPPARMOR)
|
LDLIBS += $(LIBAPPARMOR)
|
||||||
|
|
||||||
AA_EXEC = $(shell command -v aa-exec)
|
AA_EXEC = $(shell which aa-exec)
|
||||||
ifeq ($(AA_EXEC),)
|
ifeq ($(AA_EXEC),)
|
||||||
AA_EXEC_ERROR_MESSAGE = $(error ${nl}\
|
AA_EXEC_ERROR_MESSAGE = $(error ${nl}\
|
||||||
************************************************************************${nl}\
|
************************************************************************${nl}\
|
||||||
@ -188,7 +188,7 @@ SRC+=syscall_sysctl.c
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Only do xattrs_profile test if we have the required setfattr binary
|
# Only do xattrs_profile test if we have the required setfattr binary
|
||||||
ifneq (,$(shell command -v setfattr))
|
ifneq (,$(shell which setfattr > /dev/null && echo TRUE))
|
||||||
SRC+=xattrs_profile.c
|
SRC+=xattrs_profile.c
|
||||||
else
|
else
|
||||||
$(warning ${nl}\
|
$(warning ${nl}\
|
||||||
@ -199,7 +199,7 @@ Install attr or equivalent package to build and run this test${nl}\
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Only do overlayfs_fuse test if we have the required fuse-overlayfs binary
|
# Only do overlayfs_fuse test if we have the required fuse-overlayfs binary
|
||||||
ifeq (,$(shell command -v fuse-overlayfs))
|
ifeq (,$(shell which fuse-overlayfs > /dev/null && echo TRUE))
|
||||||
$(warning ${nl}\
|
$(warning ${nl}\
|
||||||
************************************************************************${nl}\
|
************************************************************************${nl}\
|
||||||
No fuse-overlayfs skipping overlayfs_fuse tests ...${nl}\
|
No fuse-overlayfs skipping overlayfs_fuse tests ...${nl}\
|
||||||
@ -328,12 +328,12 @@ TESTS=aa_exec \
|
|||||||
nfs
|
nfs
|
||||||
|
|
||||||
# Only do overlayfs_fuse test if we have the required fuse-overlayfs binary
|
# Only do overlayfs_fuse test if we have the required fuse-overlayfs binary
|
||||||
ifneq (,$(shell command -v fuse-overlayfs))
|
ifneq (,$(shell which fuse-overlayfs > /dev/null && echo TRUE))
|
||||||
TESTS+=overlayfs_fuse
|
TESTS+=overlayfs_fuse
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Only do xattrs_profile test if we have the required setfattr binary
|
# Only do xattrs_profile test if we have the required setfattr binary
|
||||||
ifneq (,$(shell command -v setfattr))
|
ifneq (,$(shell which setfattr > /dev/null && echo TRUE))
|
||||||
TESTS+=xattrs_profile
|
TESTS+=xattrs_profile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -29,5 +29,5 @@ runchecktest "Complain mode profile (file exec no permission entry)" pass exec e
|
|||||||
|
|
||||||
# This test will fail on a kernel that doesn't have
|
# This test will fail on a kernel that doesn't have
|
||||||
# https://lists.ubuntu.com/archives/apparmor/2024-August/013338.html applied
|
# https://lists.ubuntu.com/archives/apparmor/2024-August/013338.html applied
|
||||||
genprofile -C $(command -v echo):cx
|
genprofile -C $(which echo):cx
|
||||||
runchecktest "Complain mode profile (file exec cx permission entry)" pass exec echo PASS
|
runchecktest "Complain mode profile (file exec cx permission entry)" pass exec echo PASS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user