From 07b65603ffd08b396abe122ba9899533689129fd Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Mar 2021 10:27:31 +0100 Subject: [PATCH] test: check for shfmt in Makefile --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8b2a64ebf..a031440c2 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ ifeq ($(DRACUT_FULL_VERSION),) DRACUT_FULL_VERSION = $(DRACUT_VERSION) endif +HAVE_SHFMT ?= $(shell which shfmt >/dev/null 2>&1 && echo yes) + -include Makefile.inc KVERSION ?= $(shell uname -r) @@ -92,7 +94,9 @@ dracut-util: util/util indent: indent -i8 -nut -br -linux -l120 $(wildcard *.[ch] */*.[ch]) - if type -P shfmt >/dev/null; then shfmt -w -s .; fi +ifeq ($(HAVE_SHFMT),yes) + shfmt -w -s . +endif doc: $(manpages) dracut.html -- 2.47.3