diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-04-14 18:42:59 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-04-14 18:42:59 +0200 |
commit | 0705657747e31a0884ee7268515f04ee2684ae8e (patch) | |
tree | 020ee863c205cb1edb95409a635cf1a80b6da822 | |
parent | b9dda90716a2c7ae0a215f24fbdd48c923b67ddd (diff) |
build: luci.mk: gracefully handle missing or unversioned po subdirectories
Fixes: #3911
Fixes: 9d8e99f9b build: gracefully handle non-Git source trees
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | luci.mk | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -65,9 +65,13 @@ 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"; \ + 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 \ |