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>
This commit is contained in:
parent
b9dda90716
commit
0705657747
1 changed files with 7 additions and 3 deletions
10
luci.mk
10
luci.mk
|
@ -65,9 +65,13 @@ define findrev
|
||||||
$(shell \
|
$(shell \
|
||||||
if git log -1 >/dev/null 2>/dev/null; then \
|
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'); \
|
||||||
secs="$$(($$1 % 86400))"; \
|
if [ -n "$$1" ]; then
|
||||||
yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
|
secs="$$(($$1 % 86400))"; \
|
||||||
printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
|
yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
|
||||||
|
printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
|
||||||
|
else \
|
||||||
|
echo "unknown"; \
|
||||||
|
fi; \
|
||||||
else \
|
else \
|
||||||
ts=$$(find . -type f $(if $(1),-not) -path './po/*' -printf '%T@\n' 2>/dev/null | sort -rn | head -n1 | cut -d. -f1); \
|
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 \
|
if [ -n "$$ts" ]; then \
|
||||||
|
|
Loading…
Reference in a new issue