Commit a3ddce7a authored by Michael Shigorin's avatar Michael Shigorin

functions.mk: allow setting to an empty value

set() is a function of two variables but the and() check for *both* is incorrect as one might need to override a previously set variable with empty string; this has manifested itself with a case like this: @$(call set,ROOTPW_EMPTY,1) # ... @$(call set,ROOTPW_EMPTY,)
parent 2fa72595
...@@ -22,7 +22,8 @@ endef ...@@ -22,7 +22,8 @@ endef
# ...set() comments out any previous definition # ...set() comments out any previous definition
# and then appends an assigning rule... # and then appends an assigning rule...
set = $(and $(1),$(2),$(set_body)) # NB: $(2) could be empty
set = $(and $(1),$(set_body))
define set_body define set_body
{ $(log_body); \ { $(log_body); \
sed -i 's|^$(1)[ ]*[+?]*=.*$$|#& # overridden by $@|' "$(CONFIG)"; \ sed -i 's|^$(1)[ ]*[+?]*=.*$$|#& # overridden by $@|' "$(CONFIG)"; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment