build: luci.mk: fix compatibility with older Git versions
authorJo-Philipp Wich <jo@mein.io>
Wed, 15 Apr 2020 10:24:15 +0000 (12:24 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 15 Apr 2020 10:44:57 +0000 (12:44 +0200)
Fixes: 9d8e99f9b build: gracefully handle non-Git source trees
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
luci.mk

diff --git a/luci.mk b/luci.mk
index 0b3a66e3b5b8d3005003af0c84ebe6cdd5901036..d7a89d9ff1364b23e5e1a661096a2c89360557e8 100644 (file)
--- a/luci.mk
+++ b/luci.mk
@@ -64,7 +64,7 @@ PKG_NAME?=$(LUCI_NAME)
 define findrev
   $(shell \
     if git log -1 >/dev/null 2>/dev/null; then \
-      set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- '$(if $(1),:(exclude))po'); \
+      set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- $(if $(1),. ':(exclude)po',po)); \
       if [ -n "$$1" ]; then
         secs="$$(($$1 % 86400))"; \
         yday="$$(date --utc --date="@$$1" "+%y.%j")"; \