luci_mk.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. --- a/feeds/luci/luci.mk
  2. +++ b/feeds/luci/luci.mk
  3. @@ -82,7 +82,7 @@ define findrev
  4. set -- $$(git log -1 --format="%ct %h" --abbrev=7 -- $(if $(1),. ':(exclude)po',po)); \
  5. if [ -n "$$1" ]; then
  6. secs="$$(($$1 % 86400))"; \
  7. - yday="$$(date --utc --date="@$$1" "+%y.%j")"; \
  8. + yday="$$(date --utc --date="@$$(($$1 + 365*24*60*60))" "+%y.%j")"; \
  9. printf 'git-%s.%05d-%s' "$$yday" "$$secs" "$$2"; \
  10. else \
  11. echo "unknown"; \
  12. @@ -207,9 +207,20 @@ define Package/$(PKG_NAME)/install
  13. $(call Build/Install/Default)
  14. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  15. endif
  16. + ifneq ($(wildcard ${CURDIR}/po),)
  17. + $(INSTALL_DIR) $(1)/etc/uci-defaults
  18. + echo "uci set luci.languages.zh_cn='$(LUCI_LANG.zh_Hans)'; uci commit luci" \
  19. + > $(1)/etc/uci-defaults/luci-i18n-$(LUCI_BASENAME)-zh-cn
  20. + $(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR)/i18n
  21. + $(foreach po,$(wildcard ${CURDIR}/po/zh_Hans/*.po), \
  22. + po2lmo $(po) \
  23. + $(1)$(LUCI_LIBRARYDIR)/i18n/$(basename $(notdir $(po))).zh-cn.lmo;)
  24. + endif
  25. +
  26. endef
  27. ifndef Package/$(PKG_NAME)/postinst
  28. +ifneq ($(wildcard ${CURDIR}/htdocs/luci-static/resources/view),)
  29. define Package/$(PKG_NAME)/postinst
  30. [ -n "$${IPKG_INSTROOT}" ] || { \
  31. rm -f /tmp/luci-indexcache.*
  32. @@ -218,6 +229,16 @@ define Package/$(PKG_NAME)/postinst
  33. exit 0
  34. }
  35. endef
  36. +else
  37. +define Package/$(PKG_NAME)/postinst
  38. +[ -n "$${IPKG_INSTROOT}" ] || {$(foreach script,$(LUCI_DEFAULTS),
  39. + (. /etc/uci-defaults/$(script)) && rm -f /etc/uci-defaults/$(script))
  40. + rm -f /tmp/luci-indexcache.*
  41. + rm -rf /tmp/luci-modulecache/
  42. + exit 0
  43. +}
  44. +endef
  45. +endif
  46. endif
  47. # some generic macros that can be used by all packages
  48. @@ -334,5 +355,5 @@ define LuciTranslation
  49. endef
  50. -$(foreach lang,$(LUCI_LANGUAGES),$(if $(LUCI_LANG.$(lang)),$(eval $(call LuciTranslation,$(firstword $(LUCI_LC_ALIAS.$(lang)) $(lang)),$(lang)))))
  51. +# $(foreach lang,$(LUCI_LANGUAGES),$(if $(LUCI_LANG.$(lang)),$(eval $(call LuciTranslation,$(firstword $(LUCI_LC_ALIAS.$(lang)) $(lang)),$(lang)))))
  52. $(foreach pkg,$(LUCI_BUILD_PACKAGES),$(eval $(call BuildPackage,$(pkg))))