]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test: check for shfmt in Makefile
authorHarald Hoyer <harald@redhat.com>
Fri, 12 Mar 2021 09:27:31 +0000 (10:27 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 15 Mar 2021 14:37:08 +0000 (15:37 +0100)
Makefile

index 8b2a64ebf821208a5f28e7bf7d9c5e5ec006880b..a031440c25591c411b696fc7cf72b3e8a5c3ddcf 100644 (file)
--- 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