summaryrefslogtreecommitdiff
path: root/luci.mk
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-10-25 11:30:13 +0200
committerJo-Philipp Wich <jo@mein.io>2022-10-25 12:20:22 +0200
commit639e7faa1ad25b0bc2ffd5bfec79c2b9d95a50ee (patch)
tree7e51b9c915f7ab0a631b91884c9fbb11d5f859ca /luci.mk
parent39d722e00a05e9792d35770eb43810603e39e6c4 (diff)
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>
Diffstat (limited to 'luci.mk')
-rw-r--r--luci.mk5
1 files changed, 2 insertions, 3 deletions
diff --git a/luci.mk b/luci.mk
index f8d6e100bd..9776813c4f 100644
--- a/luci.mk
+++ b/luci.mk
@@ -114,9 +114,8 @@ PKG_SRC_VERSION?=$(if $(DUMP),x,$(strip $(call findrev,1)))
PKG_GITBRANCH?=$(if $(DUMP),x,$(strip $(shell \
variant="LuCI"; \
if git log -1 >/dev/null 2>/dev/null; then \
- branch=$$(git branch --remote --no-abbrev --contains 2>/dev/null | tail -n1); \
- branch=$${branch:-$$(git branch --no-abbrev --contains 2>/dev/null)}; \
- branch=$${branch#? }; branch=$${branch#*/}; \
+ branch=$$(git branch --format='%(refname:strip=3)' --remote --no-abbrev --contains 2>/dev/null | tail -n1); \
+ branch=$${branch:-$$(git branch --format='%(refname:strip=2)' --no-abbrev --contains 2>/dev/null | tail -n1)}; \
if [ "$$branch" != "master" ]; then \
variant="LuCI $${branch:-unknown} branch"; \
else \