summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Korsgaard <peter@korsgaard.com>2014-10-12 16:18:33 +0200
committerPeter Korsgaard <peter@korsgaard.com>2014-10-12 16:18:33 +0200
commit2f0748578166a4717bbbb941cf768f4dca75e971 (patch)
tree9d6ec2aaae72838bf30e7fc45d7e1b759084c439
parent2b581cc04f3b106928f3d0c3b7fb6c44e50c8a61 (diff)
downloadbuildroot-2f0748578166a4717bbbb941cf768f4dca75e971.tar.gz
buildroot-2f0748578166a4717bbbb941cf768f4dca75e971.zip
pkg-generic.mk: strip leading/trailing spaces
The manual gives this example for using the github macro: FOO_VERSION = v1.0 # tag or full commit ID Unfortunately, people copy/pasting this example will face weird make errors, because it leads the FOO_VERSION variable to end with a space. Similar problems can happen when testing a version bump or similar, so strip leading/trailing spaces before the version is used to construct the build directory path. Reported-by: Edd Robbins <edd.robbins@gmail.com> Cc: Edd Robbins <edd.robbins@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/pkg-generic.mk8
1 files changed, 4 insertions, 4 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index f09f83e6e1..259ee02801 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -318,15 +318,15 @@ $(2)_RAWNAME = $$(patsubst host-%,%,$(1))
# version control system branch or tag, for example remotes/origin/1_10_stable.
ifndef $(2)_VERSION
ifdef $(3)_VERSION
- $(2)_DL_VERSION := $$($(3)_VERSION)
- $(2)_VERSION := $$(subst /,_,$$($(3)_VERSION))
+ $(2)_DL_VERSION := $$(strip $$($(3)_VERSION))
+ $(2)_VERSION := $$(subst /,_,$$(strip $$($(3)_VERSION)))
else
$(2)_VERSION = undefined
$(2)_DL_VERSION = undefined
endif
else
- $(2)_DL_VERSION := $$($(2)_VERSION)
- $(2)_VERSION := $$(subst /,_,$$($(2)_VERSION))
+ $(2)_DL_VERSION := $$(strip $$($(2)_VERSION))
+ $(2)_VERSION := $$(strip $$(subst /,_,$$($(2)_VERSION)))
endif
$(2)_BASE_NAME = $(1)-$$($(2)_VERSION)
OpenPOWER on IntegriCloud