luci.mk: fix compatibility with GNU Make 4.2
GNU Make version 4.2 chokes on `#` characters embedded in variable substitutions, leading to the following error: ../../luci.mk:114: *** unterminated call to function 'if': missing ')'. Stop. Avoid this problem by replacing variable substitutions with Git branch format arguments. Ref: https://github.com/openwrt/luci/pull/5976#issuecomment-1289935106 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
39d722e00a
commit
639e7faa1a
1 changed files with 2 additions and 3 deletions
5
luci.mk
5
luci.mk
|
@ -114,9 +114,8 @@ PKG_SRC_VERSION?=$(if $(DUMP),x,$(strip $(call findrev,1)))
|
||||||
PKG_GITBRANCH?=$(if $(DUMP),x,$(strip $(shell \
|
PKG_GITBRANCH?=$(if $(DUMP),x,$(strip $(shell \
|
||||||
variant="LuCI"; \
|
variant="LuCI"; \
|
||||||
if git log -1 >/dev/null 2>/dev/null; then \
|
if git log -1 >/dev/null 2>/dev/null; then \
|
||||||
branch=$$(git branch --remote --no-abbrev --contains 2>/dev/null | tail -n1); \
|
branch=$$(git branch --format='%(refname:strip=3)' --remote --no-abbrev --contains 2>/dev/null | tail -n1); \
|
||||||
branch=$${branch:-$$(git branch --no-abbrev --contains 2>/dev/null)}; \
|
branch=$${branch:-$$(git branch --format='%(refname:strip=2)' --no-abbrev --contains 2>/dev/null | tail -n1)}; \
|
||||||
branch=$${branch#? }; branch=$${branch#*/}; \
|
|
||||||
if [ "$$branch" != "master" ]; then \
|
if [ "$$branch" != "master" ]; then \
|
||||||
variant="LuCI $${branch:-unknown} branch"; \
|
variant="LuCI $${branch:-unknown} branch"; \
|
||||||
else \
|
else \
|
||||||
|
|
Loading…
Reference in a new issue