From 453bf5553b1bdbc74640784a3fc9ee8f0835481e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 1 Feb 2018 22:22:55 +0100 Subject: Implement and use universal pkgauto instead of updater-ng-auto --- build_repo.sh | 5 +- pkgauto.mk | 35 ++++++ updater-ng-auto/Makefile | 206 ----------------------------------- updater-ng-auto/files/updater.config | 9 -- updater-ng/Makefile | 201 ++++++++++++++++++++++++++++++++++ updater-ng/files/updater.config | 9 ++ utils/updater-ng-auto.sh | 30 ----- 7 files changed, 248 insertions(+), 247 deletions(-) create mode 100644 pkgauto.mk delete mode 100644 updater-ng-auto/Makefile delete mode 100644 updater-ng-auto/files/updater.config create mode 100644 updater-ng/Makefile create mode 100644 updater-ng/files/updater.config delete mode 100755 utils/updater-ng-auto.sh diff --git a/build_repo.sh b/build_repo.sh index 130e239..30bfa83 100755 --- a/build_repo.sh +++ b/build_repo.sh @@ -43,8 +43,9 @@ for d in *; do [ -d .turris-sdk ] && cp -r $d .turris-sdk/package/ done -[ -d .omnia-sdk ] && ./utils/updater-ng-auto.sh .omnia-sdk/package/ -[ -d .turris-sdk ] && ./utils/updater-ng-auto.sh .turris-sdk/package/ +# Deploy pkgauto.mk +[ -d .omnia-sdk ] && cp pkgauto.mk .omnia-sdk/include/ +[ -d .turris-sdk ] && cp pkgauto.mk .turris-sdk/include/ if [ -f CONFIG ]; then echo -e "\e[1;34mApply CONFIG\e[0m" diff --git a/pkgauto.mk b/pkgauto.mk new file mode 100644 index 0000000..8bd0386 --- /dev/null +++ b/pkgauto.mk @@ -0,0 +1,35 @@ +ifneq ($(PKG_SOURCE_PROTO),git) +$(error Only supported protocol is git) +endif +ifndef PKG_NAME +$(error You have to define PKG_NAME before pkgauto.mk include) +endif +ifndef PKG_SOURCE_URL +$(error You have to define PKG_SOURCE_URL before pkgauto.mk include) +endif +ifndef PKG_SOURCE_BRANCH +$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) +endif + +TMP_REPO_PATH=/tmp/myrepo_$(PKG_NAME) + +GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare + +$(shell \ + if [ ! -d "$(TMP_REPO_PATH)" ]; then \ + git clone --bare "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ + else \ + git $(GIT_ARGS) fetch "$(PKG_SOURCE_URL)"; \ + fi \ +) + +PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) rev-parse $(PKG_SOURCE_BRANCH)) +PKG_VERSION:=$(shell git $(GIT_ARGS) describe --abbrev=0 --tags $(PKG_SOURCE_BRANCH) | sed 's/^v//') +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count v$(PKG_VERSION)..$(PKG_SOURCE_VERSION)) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME) + +# TODO drop TMP_REPO_PATH $GIT_ARGS diff --git a/updater-ng-auto/Makefile b/updater-ng-auto/Makefile deleted file mode 100644 index 7bf4782..0000000 --- a/updater-ng-auto/Makefile +++ /dev/null @@ -1,206 +0,0 @@ -# -## Copyright (C) 2016-2017 CZ.NIC z.s.p.o. (http://www.nic.cz/) -# -## This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# # -# -include $(TOPDIR)/rules.mk - -PKG_NAME:=updater-ng -PKG_VERSION:=60.0.7 -PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater.git -PKG_SOURCE_VERSION:=v$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz -PKG_SOURCE_SUBDIR:=$(PKG_NAME) -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 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk - -define Package/$(PKG_NAME) - TITLE:=The next generation updater - DEPENDS:=+liblua +libevent2 +usign +libcurl +vixie-cron +ca-certificates -endef - -define Package/$(PKG_NAME)/install - $(INSTALL_DIR) $(1)/usr/lib/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libupdater.so $(1)/usr/lib/ - - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/opkg-trans $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/pkgupdate $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/updater.sh $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/updater-unstuck.sh $(1)/usr/bin/ - $(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/entry.lua $(1)/etc/updater - $(INSTALL_DIR) $(1)/etc/updater/conf.d - $(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 - $(INSTALL_DIR) $(1)/etc/updater/hook_reboot_required - touch $(1)/etc/updater/hook_preupdate/.keep - touch $(1)/etc/updater/hook_postupdate/.keep - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/hook_reboot_required/50-create-notification.sh $(1)/etc/updater/hook_reboot_required/50-create-notification.sh - - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) ./files/updater.config $(1)/etc/config/updater -ifneq ($(PKG_BRANCH),) - echo >> $(1)/etc/config/updater - echo "config override 'override'" >> $(1)/etc/config/updater - echo " option branch '$(PKG_BRANCH)'" >> $(1)/etc/config/updater -endif - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/init $(1)/etc/init.d/updater - - $(INSTALL_DIR) $(1)/etc/cron.d - $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/cron $(1)/etc/cron.d/updater - - $(INSTALL_DIR) $(1)/etc/ssl - $(INSTALL_DATA) $(PKG_BUILD_DIR)/updater.pem $(1)/etc/ssl/updater.pem -endef - -define Package/$(PKG_NAME)/conffiles -/etc/updater/conf.d/example.lua -/etc/config/updater -endef - -define Package/$(PKG_NAME)/postinst -#!/bin/sh -if [ -z "$$IPKG_INSTROOT" ]; then - /etc/init.d/updater enable || true -fi - -# Remove morphered syntax from auto.lua -# This matches all Install and Package commands not followed by brackets. Whole -# line is enclosed with brackets and between strings and tables are added commas. -# Note: we don't have to check opkg-auto.lua as we do this migration before we -# move auto.lua to that name. -if [ -f "$$IPKG_INSTROOT/etc/updater/auto.lua" ]; then - AUTOTMP="$$(mktemp)" - sed -E '/^(Install|Package) +[^(]/{ - s/(Install|Package) +(.*)/\1(\2)/; - s/("|\}) ("|\{)/\1, \2/g - }' "$$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" -fi - -# With updater version 60.0 all configurations were moved to /etc/updater/conf.d/ -conf_move() { - if [ -f "$$IPKG_INSTROOT/etc/updater/$$1" -a ! -f "$$IPKG_INSTROOT/etc/updater/conf.d/$$2" ]; then - mv "$$IPKG_INSTROOT/etc/updater/$$1" "$$IPKG_INSTROOT/etc/updater/conf.d/$$2" - fi -} -conf_move user.lua user.lua -conf_move auto.lua opkg-auto.lua -endef - -define Build/Compile - $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) NO_DOC=1 LUA_COMPILE:=no UPDATER_VERSION:=$(PKG_VERSION) -endef - -define Host/Compile - $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) $(HOST_MAKE_FLAGS) NO_DOC=1 LUA_COMPILE:=no UPDATER_VERSION:=$(PKG_VERSION) -endef - -define Host/Install - $(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/lib/ - $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib/libupdater.so $(STAGING_DIR_HOST)/usr/lib/ - - $(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/bin - $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/opkg-trans $(STAGING_DIR_HOST)/usr/bin/ - $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/pkgupdate $(STAGING_DIR_HOST)/usr/bin/ -endef - - -define Package/$(PKG_NAME)-localrepo - TITLE:=Next generation updater local repository manager - DEPENDS:=+python-light -endef - -define Package/$(PKG_NAME)-localrepo/install - $(INSTALL_DIR) $(1)/usr/bin - $(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/localrepo/localrepo.lua $(1)/etc/updater/conf.d/localrepo.lua -endef - -# Repository should be consistent when updater is executed successfully but this -# ensures that we will fix any problems that can be caused by older version of -# localrepo -define Package/$(PKG_NAME)-localrepo/postinst -[ -n "$$IPKG_INSTROOT" ] || { - localrepo check --fix -} -endef - - -define Package/$(PKG_NAME)-opkg - TITLE:=OPKG compatibility wrapper for next generation updater - DEPENDS:=+opkg +$(PKG_NAME)-localrepo -endef - -define Package/$(PKG_NAME)-opkg/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg $(1)/usr/bin/opkg-pkgupdate-wrapper.sh - $(INSTALL_DIR) $(1)/usr/share/updater - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/localrepo/content2localrepo $(1)/usr/share/updater/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 - -# We are calling migration to localrepo from updater-ng-opkg package posinst as -# this one is called after updater-ng-localrepo one and script expect both of -# these packages. -define Package/$(PKG_NAME)-opkg/postinst -[ -n "$$IPKG_INSTROOT" ] || { - /usr/share/updater/opkg-content2localrepo.sh -} -endef - -# Current implementation of updater can't remove package before replan and so we -# can't let updater-ng steal opkg-trans files. With dependency: -# if not version_match then -# Package 'updater-ng' { deps = 'opkg-trans' } -# end -# this empty package should ensure that we correctly move packages from opkg-trans -# to updater-ng even with old version of updater. Unfortunately this won't work -# with downgrade. -# Note that because version_match was defined after package rename we can't use it -# to check version. But if it isn't defined than we know that we are using some -# old version of updater. -define Package/opkg-trans - TITLE:=Dummy opkg-trans package -endef - -define Package/opkg-trans/install - true -endef - -# This is same case as opkg-trans. Updater is package with originally obsolete -# updater version. -define Package/updater - TITLE:=Dummy updater package -endef - -define Package/updater/install - true -endef - -$(eval $(call BuildPackage,updater-ng)) -$(eval $(call BuildPackage,updater-ng-localrepo)) -$(eval $(call BuildPackage,updater-ng-opkg)) -$(eval $(call BuildPackage,opkg-trans)) -$(eval $(call BuildPackage,updater)) -$(eval $(call HostBuild)) diff --git a/updater-ng-auto/files/updater.config b/updater-ng-auto/files/updater.config deleted file mode 100644 index 4bc05ed..0000000 --- a/updater-ng-auto/files/updater.config +++ /dev/null @@ -1,9 +0,0 @@ -config pkglists pkglists - list lists 'cacerts' - list lists 'luci-controls' - list lists 'nas' - list lists 'netutils' - -config l10n 'l10n' - list langs 'cs' - list langs 'de' diff --git a/updater-ng/Makefile b/updater-ng/Makefile new file mode 100644 index 0000000..38057fe --- /dev/null +++ b/updater-ng/Makefile @@ -0,0 +1,201 @@ +# +## Copyright (C) 2016-2017 CZ.NIC z.s.p.o. (http://www.nic.cz/) +# +## This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# # +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=updater-ng +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater.git +PKG_SOURCE_BRANCH:=HEAD +PKG_MAINTAINER:=CZ.NIC +HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host + +include $(INCLUDE_DIR)/pkgauto.mk +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/$(PKG_NAME) + TITLE:=The next generation updater + DEPENDS:=+liblua +libevent2 +usign +libcurl +vixie-cron +ca-certificates +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libupdater.so $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/opkg-trans $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/pkgupdate $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/updater.sh $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/updater-unstuck.sh $(1)/usr/bin/ + $(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/entry.lua $(1)/etc/updater + $(INSTALL_DIR) $(1)/etc/updater/conf.d + $(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 + $(INSTALL_DIR) $(1)/etc/updater/hook_reboot_required + touch $(1)/etc/updater/hook_preupdate/.keep + touch $(1)/etc/updater/hook_postupdate/.keep + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/hook_reboot_required/50-create-notification.sh $(1)/etc/updater/hook_reboot_required/50-create-notification.sh + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/updater.config $(1)/etc/config/updater +ifneq ($(PKG_BRANCH),) + echo >> $(1)/etc/config/updater + echo "config override 'override'" >> $(1)/etc/config/updater + echo " option branch '$(PKG_BRANCH)'" >> $(1)/etc/config/updater +endif + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/init $(1)/etc/init.d/updater + + $(INSTALL_DIR) $(1)/etc/cron.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/cron $(1)/etc/cron.d/updater + + $(INSTALL_DIR) $(1)/etc/ssl + $(INSTALL_DATA) $(PKG_BUILD_DIR)/updater.pem $(1)/etc/ssl/updater.pem +endef + +define Package/$(PKG_NAME)/conffiles +/etc/updater/conf.d/example.lua +/etc/config/updater +endef + +define Package/$(PKG_NAME)/postinst +#!/bin/sh +if [ -z "$$IPKG_INSTROOT" ]; then + /etc/init.d/updater enable || true +fi + +# Remove morphered syntax from auto.lua +# This matches all Install and Package commands not followed by brackets. Whole +# line is enclosed with brackets and between strings and tables are added commas. +# Note: we don't have to check opkg-auto.lua as we do this migration before we +# move auto.lua to that name. +if [ -f "$$IPKG_INSTROOT/etc/updater/auto.lua" ]; then + AUTOTMP="$$(mktemp)" + sed -E '/^(Install|Package) +[^(]/{ + s/(Install|Package) +(.*)/\1(\2)/; + s/("|\}) ("|\{)/\1, \2/g + }' "$$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" +fi + +# With updater version 60.0 all configurations were moved to /etc/updater/conf.d/ +conf_move() { + if [ -f "$$IPKG_INSTROOT/etc/updater/$$1" -a ! -f "$$IPKG_INSTROOT/etc/updater/conf.d/$$2" ]; then + mv "$$IPKG_INSTROOT/etc/updater/$$1" "$$IPKG_INSTROOT/etc/updater/conf.d/$$2" + fi +} +conf_move user.lua user.lua +conf_move auto.lua opkg-auto.lua +endef + +define Build/Compile + $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) NO_DOC=1 LUA_COMPILE:=no UPDATER_VERSION:=$(PKG_VERSION) +endef + +define Host/Compile + $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) $(HOST_MAKE_FLAGS) NO_DOC=1 LUA_COMPILE:=no UPDATER_VERSION:=$(PKG_VERSION) +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/lib/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib/libupdater.so $(STAGING_DIR_HOST)/usr/lib/ + + $(INSTALL_DIR) $(STAGING_DIR_HOST)/usr/bin + $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/opkg-trans $(STAGING_DIR_HOST)/usr/bin/ + $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/pkgupdate $(STAGING_DIR_HOST)/usr/bin/ +endef + + +define Package/$(PKG_NAME)-localrepo + TITLE:=Next generation updater local repository manager + DEPENDS:=+python-light +endef + +define Package/$(PKG_NAME)-localrepo/install + $(INSTALL_DIR) $(1)/usr/bin + $(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/localrepo/localrepo.lua $(1)/etc/updater/conf.d/localrepo.lua +endef + +# Repository should be consistent when updater is executed successfully but this +# ensures that we will fix any problems that can be caused by older version of +# localrepo +define Package/$(PKG_NAME)-localrepo/postinst +[ -n "$$IPKG_INSTROOT" ] || { + localrepo check --fix +} +endef + + +define Package/$(PKG_NAME)-opkg + TITLE:=OPKG compatibility wrapper for next generation updater + DEPENDS:=+opkg +$(PKG_NAME)-localrepo +endef + +define Package/$(PKG_NAME)-opkg/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/opkg-wrapper/opkg $(1)/usr/bin/opkg-pkgupdate-wrapper.sh + $(INSTALL_DIR) $(1)/usr/share/updater + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/localrepo/content2localrepo $(1)/usr/share/updater/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 + +# We are calling migration to localrepo from updater-ng-opkg package posinst as +# this one is called after updater-ng-localrepo one and script expect both of +# these packages. +define Package/$(PKG_NAME)-opkg/postinst +[ -n "$$IPKG_INSTROOT" ] || { + /usr/share/updater/opkg-content2localrepo.sh +} +endef + +# Current implementation of updater can't remove package before replan and so we +# can't let updater-ng steal opkg-trans files. With dependency: +# if not version_match then +# Package 'updater-ng' { deps = 'opkg-trans' } +# end +# this empty package should ensure that we correctly move packages from opkg-trans +# to updater-ng even with old version of updater. Unfortunately this won't work +# with downgrade. +# Note that because version_match was defined after package rename we can't use it +# to check version. But if it isn't defined than we know that we are using some +# old version of updater. +define Package/opkg-trans + TITLE:=Dummy opkg-trans package +endef + +define Package/opkg-trans/install + true +endef + +# This is same case as opkg-trans. Updater is package with originally obsolete +# updater version. +define Package/updater + TITLE:=Dummy updater package +endef + +define Package/updater/install + true +endef + +$(eval $(call BuildPackage,updater-ng)) +$(eval $(call BuildPackage,updater-ng-localrepo)) +$(eval $(call BuildPackage,updater-ng-opkg)) +$(eval $(call BuildPackage,opkg-trans)) +$(eval $(call BuildPackage,updater)) +$(eval $(call HostBuild)) diff --git a/updater-ng/files/updater.config b/updater-ng/files/updater.config new file mode 100644 index 0000000..4bc05ed --- /dev/null +++ b/updater-ng/files/updater.config @@ -0,0 +1,9 @@ +config pkglists pkglists + list lists 'cacerts' + list lists 'luci-controls' + list lists 'nas' + list lists 'netutils' + +config l10n 'l10n' + list langs 'cs' + list langs 'de' diff --git a/utils/updater-ng-auto.sh b/utils/updater-ng-auto.sh deleted file mode 100755 index d9157a0..0000000 --- a/utils/updater-ng-auto.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# This script check if updater doesn't contain new commit and if so it bumps -# automatically. - -COMMIT=HEAD -UPDATER_REPO=https://kkoci@gitlab.labs.nic.cz/turris/updater.git -UPDATER_REPO_PATH=/tmp/myrepo_updater_repo - -if [ ! -f $1/updater-ng-auto/Makefile ]; then - # Skip this when we don't have updater-ng-auto - exit -fi - -# Update updater git repo -GIT_ARGS="--git-dir="$UPDATER_REPO_PATH" --bare" -if [ ! -d $UPDATER_REPO_PATH ]; then - git clone --bare $UPDATER_REPO $UPDATER_REPO_PATH -else - git $GIT_ARGS fetch $UPDATER_REPO master:master -fi -# Get info -HASH="$(git $GIT_ARGS rev-parse $COMMIT)" -VERSION="$(git $GIT_ARGS describe --abbrev=0 --tags $COMMIT | sed 's/^v//')" -RELEASE="$(($(git $GIT_ARGS rev-list --count v$VERSION..$COMMIT) + 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 - -echo -e "\e[1;35mUpdater-ng package has now version: $VERSION-$RELEASE\e[0m" -- cgit v1.2.3