From 7e3c1561d5dd5e03926aab60b81c62c8b728cac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 2 Nov 2017 17:17:11 +0100 Subject: Update updaer-ng-auto --- updater-ng-auto/Makefile | 31 +++++++++++++++++++++---------- utils/updater-ng-auto.sh | 5 +++-- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/updater-ng-auto/Makefile b/updater-ng-auto/Makefile index 4c1935a..21243c5 100644 --- a/updater-ng-auto/Makefile +++ b/updater-ng-auto/Makefile @@ -12,11 +12,10 @@ PKG_VERSION:=59.3 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater.git -PKG_SOURCE:=$(PKG_NAME).tar.gz PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz PKG_SOURCE_SUBDIR:=$(PKG_NAME) -PKG_MAINTAINER:=Michal Vaner +PKG_MAINTAINER:=CZ.NIC PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME) HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host @@ -41,10 +40,10 @@ define Package/$(PKG_NAME)/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/updater-wipe.sh $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc/updater - $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/* $(1)/etc/updater - + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/entry.lua $(1)/etc/updater $(INSTALL_DIR) $(1)/etc/updater/conf.d - touch $(1)/etc/updater/conf.d/.keep + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/base.lua $(1)/etc/updater/conf.d/base.lua + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/example.lua $(1)/etc/updater/conf.d/example.lua $(INSTALL_DIR) $(1)/etc/updater/hook_preupdate $(INSTALL_DIR) $(1)/etc/updater/hook_postupdate @@ -72,8 +71,8 @@ endif endef define Package/$(PKG_NAME)/conffiles -/etc/updater/auto.lua -/etc/updater/user.lua +/etc/updater/conf.d/base.lua +/etc/updater/conf.d/example.lua /etc/config/updater endef @@ -93,6 +92,14 @@ sed -E '/^(Install|Package) +[^(]/{ }' "$$IPKG_INSTROOT/etc/updater/auto.lua" > "$$AUTOTMP" # Note: Edit in place in busybox limits regexp syntax so we are using our temporally file mv "$$AUTOTMP" "$$IPKG_INSTROOT/etc/updater/auto.lua" + +# With updater version 60 all configurations were moved to /etc/updater/conf.d/ +conf_move() { + [ ! -f "$$IPKG_INSTROOT/etc/updater/$$1" ] || \ + mv "$$IPKG_INSTROOT/etc/updater/$$1" "$$IPKG_INSTROOT/etc/updater/conf.d/$$2" +} +conf_move user.lua user.lua +conf_move auto.lua opkg-auto.lua endef define Build/Compile @@ -120,7 +127,9 @@ endef define Package/$(PKG_NAME)-localrepo/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/localrepo $(1)/usr/bin/localrepo + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/localrepo/localrepo $(1)/usr/bin/localrepo + $(INSTALL_DIR) $(1)/etc/updater/conf.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg.lua $(1)/etc/updater/conf.d/opkg.lua endef @@ -131,8 +140,10 @@ endef define Package/$(PKG_NAME)-opkg/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/opkg $(1)/usr/bin/opkg-pkgupdate-wrapper.sh - $(INSTALL_BIN) $(PKG_BUILD_DIR)/utils/content2localrepo $(1)/usr/bin/updater-ng-opkg-content2localrepo.sh + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg $(1)/usr/bin/opkg-pkgupdate-wrapper.sh + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/localrepo/content2localrepo $(1)/usr/bin/updater-ng-opkg-content2localrepo.sh + $(INSTALL_DIR) $(1)/etc/updater/conf.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg.lua $(1)/etc/updater/conf.d/opkg.lua endef define Package/$(PKG_NAME)-opkg/postinst diff --git a/utils/updater-ng-auto.sh b/utils/updater-ng-auto.sh index 23eea64..a4d4194 100755 --- a/utils/updater-ng-auto.sh +++ b/utils/updater-ng-auto.sh @@ -19,8 +19,9 @@ else fi # Get info HASH="$(git $GIT_ARGS rev-parse HEAD)" -VERSION="$(git $GIT_ARGS describe --abbrev=0 --tags | sed 's/^v//').99999" -RELEASE="$(($(git $GIT_ARGS rev-list --count $VERSION..HEAD) + 1))" +VERSION="$(git $GIT_ARGS describe --abbrev=0 --tags | sed 's/^v//')" +RELEASE="$(($(git $GIT_ARGS rev-list --count v$VERSION..HEAD) + 1))" +VERSION="$VERSION.99999" # Now replace stuff in Makefile sed -i "s/^PKG_VERSION:=.*/PKG_VERSION:=$VERSION/;s/^PKG_RELEASE:=.*/PKG_RELEASE:=$RELEASE/;s/^PKG_SOURCE_VERSION:=.*/PKG_SOURCE_VERSION:=$HASH/" $1/updater-ng-auto/Makefile -- cgit v1.2.3