From 91808ad710401cb39a36d08f1c18cd092a5aa432 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 7 Jan 2020 14:40:24 +0100 Subject: [PATCH] nodewatcher: Use Makefile version for nodewatcher data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Fabian Bläse --- src/packages/fff/fff-nodewatcher/Makefile | 3 ++- .../files/usr/lib/nodewatcher.d/10-systemdata.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/packages/fff/fff-nodewatcher/Makefile b/src/packages/fff/fff-nodewatcher/Makefile index 19dd9cd..78475e5 100644 --- a/src/packages/fff/fff-nodewatcher/Makefile +++ b/src/packages/fff/fff-nodewatcher/Makefile @@ -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))) diff --git a/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh b/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh index f4a6980..c9a315e 100755 --- a/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh +++ b/src/packages/fff/fff-nodewatcher/files/usr/lib/nodewatcher.d/10-systemdata.sh @@ -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")