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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user