Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/luci.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-10 00:11:41 +0300
committerJo-Philipp Wich <jo@mein.io>2020-04-10 00:23:33 +0300
commit372c54ec6f4d319b8d29e1e5474847cdd57f0fe5 (patch)
treec8a8293d51516cffb34c338cf85efac5cb8e3efb /luci.mk
parent59fe4086f3a93f919547154373ac3d5e975e7db2 (diff)
build: luci.mk: rework package version handling
- Derive the version of packages from the last change of the sources - Derive the version of i18n packages from the last change of the po dir Fixes: #2257 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'luci.mk')
-rw-r--r--luci.mk13
1 files changed, 11 insertions, 2 deletions
diff --git a/luci.mk b/luci.mk
index 6be83a4f52..456fa016ee 100644
--- a/luci.mk
+++ b/luci.mk
@@ -59,8 +59,15 @@ LUCI_LC_ALIAS.zh_Hant=zh-tw
PKG_NAME?=$(LUCI_NAME)
-PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \
- set -- $$(git log -1 --format="%ct %h" --abbrev=7); \
+PKG_PO_VERSION?=$(if $(DUMP),x,$(strip $(shell \
+ set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- po); \
+ secs="$$(($$1 % 86400))"; \
+ yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
+ printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2" \
+)))
+
+PKG_SRC_VERSION?=$(if $(DUMP),x,$(strip $(shell \
+ set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- . ':(exclude)po'); \
secs="$$(($$1 % 86400))"; \
yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2" \
@@ -95,6 +102,7 @@ define Package/$(PKG_NAME)
SUBMENU:=$(if $(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.$(LUCI_TYPE)),$(LUCI_MENU.app))
TITLE:=$(if $(LUCI_TITLE),$(LUCI_TITLE),LuCI $(LUCI_NAME) $(LUCI_TYPE))
DEPENDS:=$(LUCI_DEPENDS)
+ VERSION:=$(PKG_SRC_VERSION)
$(if $(LUCI_EXTRA_DEPENDS),EXTRA_DEPENDS:=$(LUCI_EXTRA_DEPENDS))
$(if $(LUCI_PKGARCH),PKGARCH:=$(LUCI_PKGARCH))
endef
@@ -236,6 +244,7 @@ define LuciTranslation
HIDDEN:=1
DEFAULT:=LUCI_LANG_$(2)||(ALL&&m)
DEPENDS:=$(PKG_NAME)
+ VERSION:=$(PKG_PO_VERSION)
PKGARCH:=all
endef