Kaydet (Commit) 50b10feb authored tarafından Michael Stahl's avatar Michael Stahl

gbuild: tweak var2file so it handles some shell metacharacters

Always quote the passed string; this cannot handle arbitrary strings
like $(file) can, but everything that is needed currently.

Also, try to ensure that output does not start with a space.

Note: there needs to be a newline at the end, otherwise helpex
ignores the last item on the line.

Change-Id: I51a4058591cc4f12dd878c2d113bd5cfc8c22d61
üst 0d2542d6
......@@ -29,13 +29,14 @@ else
define var2file
$(strip $(1)
$(eval gb_var2file_helpervar := $$(shell printf "%s" "" > $(1) ))\
$(foreach item,$(3),$(eval gb_var2file_curblock += $(item)
$(eval gb_var2file_curblock := $(firstword $(3)))\
$(foreach item,$(wordlist 2,99999,$(3)),$(eval gb_var2file_curblock += $(item)
ifeq ($$(words $$(gb_var2file_curblock)),$(2))
gb_var2file_helpervar := $$(shell printf "%s" "$$(gb_var2file_curblock)" >> $(1) )
gb_var2file_curblock :=
endif
))\
$(eval gb_var2file_helpervar := $(shell echo " "$(gb_var2file_curblock) >> $(1) )
$(eval gb_var2file_helpervar := $(shell printf "%s\n" "$(gb_var2file_curblock)" >> $(1) )
gb_var2file_curblock :=
))
endef
......
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