nodewatcher: Use Makefile version for nodewatcher data

So far, nodewatcher version has to be specified twice, once in the
Makefile and again in the nodewatcher script.

With this patch, a version file is created during build than can
be read in nodewatcher script, so version only has to be specified
once anymore. The file name mimics the version files already present
for OpenWrt and our firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
This commit is contained in:
Adrian Schmutzler 2020-01-07 14:40:24 +01:00 committed by Fabian Bläse
parent 498c6ad963
commit 91808ad710
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-nodewatcher
PKG_RELEASE:=58
PKG_RELEASE:=59
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@ -36,6 +36,7 @@ endef
define Package/$(PKG_NAME)/install
$(CP) ./files/* $(1)/
printf "$(if $(PKG_VERSION),$(PKG_VERSION).)$(PKG_RELEASE)" >> $(1)/etc/nodewatcher_version
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -3,7 +3,7 @@
# License; GPL v3
SCRIPT_STATUS_FILE=$(uci get nodewatcher.@script[0].status_text_file)
SCRIPT_VERSION="58"
SCRIPT_VERSION=$(cat /etc/nodewatcher_version)
debug() {
(>&2 echo "$1")