luci-base: uci.js: fix section deletion logic
[oweals/luci.git] / luci.mk
diff --git a/luci.mk b/luci.mk
index 621008aa8743876a7d08aacc16844dbf1b098373..d7a89d9ff1364b23e5e1a661096a2c89360557e8 100644 (file)
--- a/luci.mk
+++ b/luci.mk
@@ -64,10 +64,14 @@ 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'); \
-      secs="$$(($$1 % 86400))"; \
-      yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
-      printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
+      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")"; \
+        printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
+      else \
+        echo "unknown"; \
+      fi; \
     else \
       ts=$$(find . -type f $(if $(1),-not) -path './po/*' -printf '%T@\n' 2>/dev/null | sort -rn | head -n1 | cut -d. -f1); \
       if [ -n "$$ts" ]; then \