diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-06-04 22:13:13 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-06-09 17:05:53 +0200 |
commit | 50b10febf3d8fa76d928581b93c4dbd07a086ad5 (patch) | |
tree | b9f6613a4f9eca9663f933f6fa843d0905557108 /solenv/gbuild/Tempfile.mk | |
parent | 0d2542d67ab77134e91317d45ea62e548a692067 (diff) |
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
Diffstat (limited to 'solenv/gbuild/Tempfile.mk')
-rw-r--r-- | solenv/gbuild/Tempfile.mk | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/solenv/gbuild/Tempfile.mk b/solenv/gbuild/Tempfile.mk index d10e1d2d1fe0..3fede2abb774 100644 --- a/solenv/gbuild/Tempfile.mk +++ b/solenv/gbuild/Tempfile.mk @@ -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 |