From 20a247f8ea2b0c6cab8bbb00b065fed8f9d5644e Mon Sep 17 00:00:00 2001 From: Manuel Messner Date: Mon, 19 Feb 2018 10:36:14 +0100 Subject: Makefile: fix ROOTPW check For the base target, the password must only be checked for existance; not for correctness, too. The comparison file does not exist yet. We cannot simply do a $(filter /base,$(PW_NEEDED)) because the base target might be included implicitely. What we do instead is, we check for the existance of the base directory and only if it exists, we do the comparison. --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9ea75dd..a492b9a 100644 --- a/Makefile +++ b/Makefile @@ -64,9 +64,11 @@ ifneq ($(PW_NEEDED),) $(error No root password is set, set it as ROOTPW in your environment.) else $(foreach cur,$(PW_NEEDED),\ - $(shell printf "$(ROOTPW)" | $(HASHER) --check --status "$(firstword $(subst /, ,$(cur)))/base/rootpw.$(HASHER)")\ - $(if $(filter 1,$(.SHELLSTATUS)),\ - $(error The wrong ROOTPW is set. Please correct it))) + $(eval cur_dir := $(firstword $(subst /, ,$(cur)))/base)\ + $(if $(shell test -d "$(cur_dir)" && echo yes),\ + $(shell echo "$(ROOTPW)" | $(HASHER) --check --status "$(cur_dir)/rootpw.$(HASHER)")\ + $(if $(filter 1,$(.SHELLSTATUS)),\ + $(error The wrong ROOTPW is set. Please correct it)))) endif endif -- cgit v1.2.3-55-g7522