From 3a2aa9ec45d7bfadbb36bcb02365c1669ede7e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 24 Aug 2018 18:38:57 +0200 Subject: Add updater-ng package This is updater-ng package tracking master branch. --- updater-ng/Makefile | 261 +++++++++++++++++++++++++++++++++++++++ updater-ng/files/updater-wipe.sh | 4 + updater-ng/files/updater.config | 9 ++ 3 files changed, 274 insertions(+) create mode 100644 updater-ng/Makefile create mode 100755 updater-ng/files/updater-wipe.sh create mode 100644 updater-ng/files/updater.config diff --git a/updater-ng/Makefile b/updater-ng/Makefile new file mode 100644 index 0000000..89ec3a2 --- /dev/null +++ b/updater-ng/Makefile @@ -0,0 +1,261 @@ +# +## 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_URL:=https://gitlab.labs.nic.cz/turris/updater.git +PKG_SOURCE_BRANCH:=master +PKG_MAINTAINER:=CZ.NIC +HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host +PKG_BUILD_DEPENDS+=busybox-static + +$(call include_mk, autopkg-branch.mk) +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk +include $(TOPDIR)/feeds/packages/lang/python/python-package.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk + +define Package/$(PKG_NAME) + TITLE:=The next generation updater + DEPENDS:=+liblua +libuci-lua +libevent2 +usign +libcurl +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/supervisor/updater.sh $(1)/usr/bin/ + $(INSTALL_BIN) .//files/updater-wipe.sh $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/updater + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/conf.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 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/hook_postupdate/update_alternatives.sh $(1)/etc/updater/hook_postupdate/update_alternatives.sh + $(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 +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) BUSYBOX_EXEC=$(STAGING_DIR)/bin/busybox-static + $(call Build/Compile/PyMod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR)/py2) + $(call Build/Compile/Py3Mod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR)/py3) +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)-supervisor + TITLE:=Next generation updater supervisor + DEPENDS:=+updater-ng-py3-supervisor +updater-ng +vixie-cron +endef + +define Package/$(PKG_NAME)-supervisor/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/updater-supervisor $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/cron.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/supervisor/cron $(1)/etc/cron.d/updater + + $(INSTALL_DIR) $(1)/etc/updater/hook_postupdate + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/hook_postupdate $(1)/etc/updater/hook_postupdate/99_approvals_cleanup +endef + + +define Package/$(PKG_NAME)-py2-supervisor + TITLE:=Next generation updater supervisor Python 2 library + DEPENDS:=+updater-ng +python-light +python-uci +userlists +l10n_supported + EXTRA_DEPENDS:=userlists (>=11) +endef + + +define Package/$(PKG_NAME)-py3-supervisor + TITLE:=Next generation updater supervisor Python 3 library + DEPENDS:=+updater-ng +python3-light +python3-uci +userlists +l10n_supported + EXTRA_DEPENDS:=userlists (>=11) +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 + +# We are migrating away from Nuci for Foris. But during this migration there is +# a problem where updater update it self and then requests approval. But because +# we dropped some files nuci expects and Foris is not yet updated there is no way +# user can easily approve update. Solution is to have package providing those +# missing file and install it temporally just to fix that problem. +define Package/$(PKG_NAME)-migration-helper + TITLE:=Package for smoot migration of updater-ng +endef + +define Package/$(PKG_NAME)-migration-helper/install + $(INSTALL_DIR) $(1)/usr/bin + echo '#!/bin/sh' > $(1)/usr/bin/updater-unstuck.sh + chmod +x $(1)/usr/bin/updater-unstuck.sh +endef +# updater-wipe.sh is temporally in updater-ng package for Foris Wizard +# compatibility. We should drop it from updater-ng when wizard is dropped and +# return it to this package. +# echo '#!/bin/sh' > $(1)/usr/bin/updater-wipe.sh +# chmod +x $(1)/usr/bin/updater-wipe.sh + + +PKG_INSTALL_DIR_ORIG:="$(PKG_INSTALL_DIR)" +PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)/py2" +$(eval $(call PyPackage,updater-ng-py2-supervisor)) +PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)/py3" +$(eval $(call Py3Package,updater-ng-py3-supervisor)) +PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)" + +$(eval $(call BuildPackage,updater-ng)) +$(eval $(call BuildPackage,updater-ng-supervisor)) +$(eval $(call BuildPackage,updater-ng-py2-supervisor)) +$(eval $(call BuildPackage,updater-ng-py3-supervisor)) +$(eval $(call BuildPackage,updater-ng-localrepo)) +$(eval $(call BuildPackage,updater-ng-opkg)) +$(eval $(call BuildPackage,opkg-trans)) +$(eval $(call BuildPackage,updater)) +$(eval $(call BuildPackage,updater-ng-migration-helper)) +$(eval $(call HostBuild)) diff --git a/updater-ng/files/updater-wipe.sh b/updater-ng/files/updater-wipe.sh new file mode 100755 index 0000000..7bd6ba8 --- /dev/null +++ b/updater-ng/files/updater-wipe.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Empty... +# This file exists only for backward compatibility with Foris wizard and nuci. +# With Foris wizard removal we should drop this. 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' -- cgit v1.2.3 From dd7d618bd8ab59b86ef64ecc64e8becf026cb5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 26 Aug 2018 13:48:24 +0200 Subject: Move explicit fetch to correct autopkg variant --- autopkg-branch.mk | 3 +++ autopkg-tag.mk | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autopkg-branch.mk b/autopkg-branch.mk index 871cffb..25e25e9 100644 --- a/autopkg-branch.mk +++ b/autopkg-branch.mk @@ -6,6 +6,9 @@ ifndef PKG_SOURCE_BRANCH $(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) endif +# Explicitly fetch branch +$(shell git $(GIT_ARGS) fetch --prune --prune-tags --force "$(PKG_SOURCE_URL)" "$(PKG_SOURCE_BRANCH):$(PKG_SOURCE_BRANCH)") + 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)") diff --git a/autopkg-tag.mk b/autopkg-tag.mk index 9e97ed7..6fe08d4 100644 --- a/autopkg-tag.mk +++ b/autopkg-tag.mk @@ -2,9 +2,6 @@ AUTOPKG_VARIANT:=tag $(call include_mk, autopkg-common.mk) -# Explicitly fetch branch -$(shell git $(GIT_ARGS) fetch --prune --prune-tags --force "$(PKG_SOURCE_URL)" "$(PKG_SOURCE_BRANCH):$(PKG_SOURCE_BRANCH)") - PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) -- cgit v1.2.3 From c8654a69b75c4f52fa4da372d997708c8a4ecdcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 27 Aug 2018 13:35:53 +0200 Subject: Temporally drop all advanced packages --- shellrc/Makefile | 58 --------- updater-ng/Makefile | 261 --------------------------------------- updater-ng/files/updater-wipe.sh | 4 - updater-ng/files/updater.config | 9 -- 4 files changed, 332 deletions(-) delete mode 100644 shellrc/Makefile delete mode 100644 updater-ng/Makefile delete mode 100755 updater-ng/files/updater-wipe.sh delete mode 100644 updater-ng/files/updater.config diff --git a/shellrc/Makefile b/shellrc/Makefile deleted file mode 100644 index 628dd9f..0000000 --- a/shellrc/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# -## Copyright (C) 2018 Karel Kočí -# -## This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# # -# -include $(TOPDIR)/rules.mk - -PKG_NAME:=shellrc -PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://git.cynerd.cz/shellrc -PKG_MAINTAINER:=Karel Kočí - -$(call include_mk, autopkg-tag.mk) -include $(INCLUDE_DIR)/package.mk - -define Package/$(PKG_NAME) - TITLE:=Shell initialization files -endef - -define Package/$(PKG_NAME)-bash - TITLE:=Shell initialization files bash specific - DEPENDS:=$(PKG_NAME) bash -endef - -define Package/$(PKG_NAME)-zsh - TITLE:=Shell initialization files zsh specific - DEPENDS:=$(PKG_NAME) zsh -endef - -define Package/$(PKG_NAME)-ash - TITLE:=Shell initialization files ash specific - DEPENDS:=$(PKG_NAME) -endef - -define Build/Compile - true -endef - -define Package/$(PKG_NAME)/install - $(PKG_BUILD_DIR)/install --prefix "$(1)" -endef - -define Package/$(PKG_NAME)-bash/install - $(PKG_BUILD_DIR)/install --prefix "$(1)" --bash --no-base -endef - -define Package/$(PKG_NAME)-zsh/install - $(PKG_BUILD_DIR)/install --prefix "$(1)" --zsh --no-base -endef - -define Package/$(PKG_NAME)-ash/install - # TODO - #$(PKG_BUILD_DIR)/install --prefix "$(1)" --ash --no-base -endef - -$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/updater-ng/Makefile b/updater-ng/Makefile deleted file mode 100644 index 89ec3a2..0000000 --- a/updater-ng/Makefile +++ /dev/null @@ -1,261 +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_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater.git -PKG_SOURCE_BRANCH:=master -PKG_MAINTAINER:=CZ.NIC -HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host -PKG_BUILD_DEPENDS+=busybox-static - -$(call include_mk, autopkg-branch.mk) -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk -include $(TOPDIR)/feeds/packages/lang/python/python-package.mk -include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk - -define Package/$(PKG_NAME) - TITLE:=The next generation updater - DEPENDS:=+liblua +libuci-lua +libevent2 +usign +libcurl +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/supervisor/updater.sh $(1)/usr/bin/ - $(INSTALL_BIN) .//files/updater-wipe.sh $(1)/usr/bin/ - - $(INSTALL_DIR) $(1)/etc/updater - $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/conf.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 - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/hook_postupdate/update_alternatives.sh $(1)/etc/updater/hook_postupdate/update_alternatives.sh - $(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 -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) BUSYBOX_EXEC=$(STAGING_DIR)/bin/busybox-static - $(call Build/Compile/PyMod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR)/py2) - $(call Build/Compile/Py3Mod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR)/py3) -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)-supervisor - TITLE:=Next generation updater supervisor - DEPENDS:=+updater-ng-py3-supervisor +updater-ng +vixie-cron -endef - -define Package/$(PKG_NAME)-supervisor/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/updater-supervisor $(1)/usr/bin/ - - $(INSTALL_DIR) $(1)/etc/cron.d - $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/supervisor/cron $(1)/etc/cron.d/updater - - $(INSTALL_DIR) $(1)/etc/updater/hook_postupdate - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/hook_postupdate $(1)/etc/updater/hook_postupdate/99_approvals_cleanup -endef - - -define Package/$(PKG_NAME)-py2-supervisor - TITLE:=Next generation updater supervisor Python 2 library - DEPENDS:=+updater-ng +python-light +python-uci +userlists +l10n_supported - EXTRA_DEPENDS:=userlists (>=11) -endef - - -define Package/$(PKG_NAME)-py3-supervisor - TITLE:=Next generation updater supervisor Python 3 library - DEPENDS:=+updater-ng +python3-light +python3-uci +userlists +l10n_supported - EXTRA_DEPENDS:=userlists (>=11) -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 - -# We are migrating away from Nuci for Foris. But during this migration there is -# a problem where updater update it self and then requests approval. But because -# we dropped some files nuci expects and Foris is not yet updated there is no way -# user can easily approve update. Solution is to have package providing those -# missing file and install it temporally just to fix that problem. -define Package/$(PKG_NAME)-migration-helper - TITLE:=Package for smoot migration of updater-ng -endef - -define Package/$(PKG_NAME)-migration-helper/install - $(INSTALL_DIR) $(1)/usr/bin - echo '#!/bin/sh' > $(1)/usr/bin/updater-unstuck.sh - chmod +x $(1)/usr/bin/updater-unstuck.sh -endef -# updater-wipe.sh is temporally in updater-ng package for Foris Wizard -# compatibility. We should drop it from updater-ng when wizard is dropped and -# return it to this package. -# echo '#!/bin/sh' > $(1)/usr/bin/updater-wipe.sh -# chmod +x $(1)/usr/bin/updater-wipe.sh - - -PKG_INSTALL_DIR_ORIG:="$(PKG_INSTALL_DIR)" -PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)/py2" -$(eval $(call PyPackage,updater-ng-py2-supervisor)) -PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)/py3" -$(eval $(call Py3Package,updater-ng-py3-supervisor)) -PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)" - -$(eval $(call BuildPackage,updater-ng)) -$(eval $(call BuildPackage,updater-ng-supervisor)) -$(eval $(call BuildPackage,updater-ng-py2-supervisor)) -$(eval $(call BuildPackage,updater-ng-py3-supervisor)) -$(eval $(call BuildPackage,updater-ng-localrepo)) -$(eval $(call BuildPackage,updater-ng-opkg)) -$(eval $(call BuildPackage,opkg-trans)) -$(eval $(call BuildPackage,updater)) -$(eval $(call BuildPackage,updater-ng-migration-helper)) -$(eval $(call HostBuild)) diff --git a/updater-ng/files/updater-wipe.sh b/updater-ng/files/updater-wipe.sh deleted file mode 100755 index 7bd6ba8..0000000 --- a/updater-ng/files/updater-wipe.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Empty... -# This file exists only for backward compatibility with Foris wizard and nuci. -# With Foris wizard removal we should drop this. diff --git a/updater-ng/files/updater.config b/updater-ng/files/updater.config deleted file mode 100644 index 4bc05ed..0000000 --- a/updater-ng/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' -- cgit v1.2.3 From 7b230877a32027b4aef12685ca282db107301145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 11:12:19 +0200 Subject: autopkg: try to fix pull --- autopkg-branch.mk | 3 --- autopkg-common.mk | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/autopkg-branch.mk b/autopkg-branch.mk index 25e25e9..871cffb 100644 --- a/autopkg-branch.mk +++ b/autopkg-branch.mk @@ -6,9 +6,6 @@ ifndef PKG_SOURCE_BRANCH $(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) endif -# Explicitly fetch branch -$(shell git $(GIT_ARGS) fetch --prune --prune-tags --force "$(PKG_SOURCE_URL)" "$(PKG_SOURCE_BRANCH):$(PKG_SOURCE_BRANCH)") - 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)") diff --git a/autopkg-common.mk b/autopkg-common.mk index 73cff51..c539e1a 100644 --- a/autopkg-common.mk +++ b/autopkg-common.mk @@ -13,12 +13,11 @@ TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare # Clone/update git history to bare repository -# TODO it is possible that this won't fetch when there is force push to repository $(shell \ if [ ! -d "$(TMP_REPO_PATH)" ]; then \ - git clone --bare "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ + git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ else \ - git $(GIT_ARGS) fetch --prune --prune-tags --force "$(PKG_SOURCE_URL)"; \ + git $(GIT_ARGS) remote update origin; \ fi) -- cgit v1.2.3 From cef196855f630f7bfd1850e0e50c8fb21bfe8891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 11:16:06 +0200 Subject: Revert "Temporally drop all advanced packages" This reverts commit c8654a69b75c4f52fa4da372d997708c8a4ecdcf. --- shellrc/Makefile | 58 +++++++++ updater-ng/Makefile | 261 +++++++++++++++++++++++++++++++++++++++ updater-ng/files/updater-wipe.sh | 4 + updater-ng/files/updater.config | 9 ++ 4 files changed, 332 insertions(+) create mode 100644 shellrc/Makefile create mode 100644 updater-ng/Makefile create mode 100755 updater-ng/files/updater-wipe.sh create mode 100644 updater-ng/files/updater.config diff --git a/shellrc/Makefile b/shellrc/Makefile new file mode 100644 index 0000000..628dd9f --- /dev/null +++ b/shellrc/Makefile @@ -0,0 +1,58 @@ +# +## Copyright (C) 2018 Karel Kočí +# +## This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# # +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=shellrc +PKG_RELEASE:=1 +PKG_SOURCE_URL:=https://git.cynerd.cz/shellrc +PKG_MAINTAINER:=Karel Kočí + +$(call include_mk, autopkg-tag.mk) +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + TITLE:=Shell initialization files +endef + +define Package/$(PKG_NAME)-bash + TITLE:=Shell initialization files bash specific + DEPENDS:=$(PKG_NAME) bash +endef + +define Package/$(PKG_NAME)-zsh + TITLE:=Shell initialization files zsh specific + DEPENDS:=$(PKG_NAME) zsh +endef + +define Package/$(PKG_NAME)-ash + TITLE:=Shell initialization files ash specific + DEPENDS:=$(PKG_NAME) +endef + +define Build/Compile + true +endef + +define Package/$(PKG_NAME)/install + $(PKG_BUILD_DIR)/install --prefix "$(1)" +endef + +define Package/$(PKG_NAME)-bash/install + $(PKG_BUILD_DIR)/install --prefix "$(1)" --bash --no-base +endef + +define Package/$(PKG_NAME)-zsh/install + $(PKG_BUILD_DIR)/install --prefix "$(1)" --zsh --no-base +endef + +define Package/$(PKG_NAME)-ash/install + # TODO + #$(PKG_BUILD_DIR)/install --prefix "$(1)" --ash --no-base +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/updater-ng/Makefile b/updater-ng/Makefile new file mode 100644 index 0000000..89ec3a2 --- /dev/null +++ b/updater-ng/Makefile @@ -0,0 +1,261 @@ +# +## 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_URL:=https://gitlab.labs.nic.cz/turris/updater.git +PKG_SOURCE_BRANCH:=master +PKG_MAINTAINER:=CZ.NIC +HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host +PKG_BUILD_DEPENDS+=busybox-static + +$(call include_mk, autopkg-branch.mk) +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk +include $(TOPDIR)/feeds/packages/lang/python/python-package.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk + +define Package/$(PKG_NAME) + TITLE:=The next generation updater + DEPENDS:=+liblua +libuci-lua +libevent2 +usign +libcurl +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/supervisor/updater.sh $(1)/usr/bin/ + $(INSTALL_BIN) .//files/updater-wipe.sh $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/updater + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/pkgupdate/configs/conf.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 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pkgupdate/hook_postupdate/update_alternatives.sh $(1)/etc/updater/hook_postupdate/update_alternatives.sh + $(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 +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) BUSYBOX_EXEC=$(STAGING_DIR)/bin/busybox-static + $(call Build/Compile/PyMod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR)/py2) + $(call Build/Compile/Py3Mod,src/supervisor,install --prefix="/usr" --root=$(PKG_INSTALL_DIR)/py3) +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)-supervisor + TITLE:=Next generation updater supervisor + DEPENDS:=+updater-ng-py3-supervisor +updater-ng +vixie-cron +endef + +define Package/$(PKG_NAME)-supervisor/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/updater-supervisor $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/cron.d + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/supervisor/cron $(1)/etc/cron.d/updater + + $(INSTALL_DIR) $(1)/etc/updater/hook_postupdate + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/supervisor/hook_postupdate $(1)/etc/updater/hook_postupdate/99_approvals_cleanup +endef + + +define Package/$(PKG_NAME)-py2-supervisor + TITLE:=Next generation updater supervisor Python 2 library + DEPENDS:=+updater-ng +python-light +python-uci +userlists +l10n_supported + EXTRA_DEPENDS:=userlists (>=11) +endef + + +define Package/$(PKG_NAME)-py3-supervisor + TITLE:=Next generation updater supervisor Python 3 library + DEPENDS:=+updater-ng +python3-light +python3-uci +userlists +l10n_supported + EXTRA_DEPENDS:=userlists (>=11) +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 + +# We are migrating away from Nuci for Foris. But during this migration there is +# a problem where updater update it self and then requests approval. But because +# we dropped some files nuci expects and Foris is not yet updated there is no way +# user can easily approve update. Solution is to have package providing those +# missing file and install it temporally just to fix that problem. +define Package/$(PKG_NAME)-migration-helper + TITLE:=Package for smoot migration of updater-ng +endef + +define Package/$(PKG_NAME)-migration-helper/install + $(INSTALL_DIR) $(1)/usr/bin + echo '#!/bin/sh' > $(1)/usr/bin/updater-unstuck.sh + chmod +x $(1)/usr/bin/updater-unstuck.sh +endef +# updater-wipe.sh is temporally in updater-ng package for Foris Wizard +# compatibility. We should drop it from updater-ng when wizard is dropped and +# return it to this package. +# echo '#!/bin/sh' > $(1)/usr/bin/updater-wipe.sh +# chmod +x $(1)/usr/bin/updater-wipe.sh + + +PKG_INSTALL_DIR_ORIG:="$(PKG_INSTALL_DIR)" +PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)/py2" +$(eval $(call PyPackage,updater-ng-py2-supervisor)) +PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)/py3" +$(eval $(call Py3Package,updater-ng-py3-supervisor)) +PKG_INSTALL_DIR:="$(PKG_INSTALL_DIR_ORIG)" + +$(eval $(call BuildPackage,updater-ng)) +$(eval $(call BuildPackage,updater-ng-supervisor)) +$(eval $(call BuildPackage,updater-ng-py2-supervisor)) +$(eval $(call BuildPackage,updater-ng-py3-supervisor)) +$(eval $(call BuildPackage,updater-ng-localrepo)) +$(eval $(call BuildPackage,updater-ng-opkg)) +$(eval $(call BuildPackage,opkg-trans)) +$(eval $(call BuildPackage,updater)) +$(eval $(call BuildPackage,updater-ng-migration-helper)) +$(eval $(call HostBuild)) diff --git a/updater-ng/files/updater-wipe.sh b/updater-ng/files/updater-wipe.sh new file mode 100755 index 0000000..7bd6ba8 --- /dev/null +++ b/updater-ng/files/updater-wipe.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Empty... +# This file exists only for backward compatibility with Foris wizard and nuci. +# With Foris wizard removal we should drop this. 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' -- cgit v1.2.3 From d7b7793976ee2d1fac1763c224edcc7405168c57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 11:18:06 +0200 Subject: Move autopkg to package so it is accessible --- autopkg-branch.mk | 24 -------------------- autopkg-common.mk | 36 ------------------------------ autopkg-tag.mk | 8 ------- personal-pkgs-repo/files/autopkg-branch.mk | 24 ++++++++++++++++++++ personal-pkgs-repo/files/autopkg-common.mk | 36 ++++++++++++++++++++++++++++++ personal-pkgs-repo/files/autopkg-tag.mk | 8 +++++++ 6 files changed, 68 insertions(+), 68 deletions(-) delete mode 100644 autopkg-branch.mk delete mode 100644 autopkg-common.mk delete mode 100644 autopkg-tag.mk create mode 100644 personal-pkgs-repo/files/autopkg-branch.mk create mode 100644 personal-pkgs-repo/files/autopkg-common.mk create mode 100644 personal-pkgs-repo/files/autopkg-tag.mk diff --git a/autopkg-branch.mk b/autopkg-branch.mk deleted file mode 100644 index 871cffb..0000000 --- a/autopkg-branch.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Autopkg tracking given branch -AUTOPKG_VARIANT:=branch -$(call include_mk, autopkg-common.mk) - -ifndef PKG_SOURCE_BRANCH -$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) -endif - -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)") - -ifeq ($(PKG_VERSION),) -# Count commits since initial commit. -PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_SOURCE_VERSION)") -# No previous version found (no tag) so we use 9999 instead -PKG_VERSION:=9999 -else -# Count commits since last version tag -PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOURCE_VERSION)") -# .9999 is appended to not collide with possible existing package versions in repository -PKG_VERSION:=$(PKG_VERSION:v%=%).9999 -endif - -$(eval $(call AUTOPKG_TAIL)) diff --git a/autopkg-common.mk b/autopkg-common.mk deleted file mode 100644 index c539e1a..0000000 --- a/autopkg-common.mk +++ /dev/null @@ -1,36 +0,0 @@ -ifndef AUTOPKG_VARIANT - $(error "Don't include autopkg-common.mk directly!") -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 - -TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) -GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare - -# Clone/update git history to bare repository -$(shell \ - if [ ! -d "$(TMP_REPO_PATH)" ]; then \ - git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ - else \ - git $(GIT_ARGS) remote update origin; \ - fi) - - -define AUTOPKG_TAIL - -PKG_SOURCE_PROTO:=git -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) - -undefine TMP_REPO_PATH -undefine GIT_ARGS -undefine AUTOPKG_TAIL - -endef diff --git a/autopkg-tag.mk b/autopkg-tag.mk deleted file mode 100644 index 6fe08d4..0000000 --- a/autopkg-tag.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Autopkg tracking latest version tag -AUTOPKG_VARIANT:=tag -$(call include_mk, autopkg-common.mk) - -PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) -PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) - -$(eval $(call AUTOPKG_TAIL)) diff --git a/personal-pkgs-repo/files/autopkg-branch.mk b/personal-pkgs-repo/files/autopkg-branch.mk new file mode 100644 index 0000000..871cffb --- /dev/null +++ b/personal-pkgs-repo/files/autopkg-branch.mk @@ -0,0 +1,24 @@ +# Autopkg tracking given branch +AUTOPKG_VARIANT:=branch +$(call include_mk, autopkg-common.mk) + +ifndef PKG_SOURCE_BRANCH +$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) +endif + +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)") + +ifeq ($(PKG_VERSION),) +# Count commits since initial commit. +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_SOURCE_VERSION)") +# No previous version found (no tag) so we use 9999 instead +PKG_VERSION:=9999 +else +# Count commits since last version tag +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOURCE_VERSION)") +# .9999 is appended to not collide with possible existing package versions in repository +PKG_VERSION:=$(PKG_VERSION:v%=%).9999 +endif + +$(eval $(call AUTOPKG_TAIL)) diff --git a/personal-pkgs-repo/files/autopkg-common.mk b/personal-pkgs-repo/files/autopkg-common.mk new file mode 100644 index 0000000..c539e1a --- /dev/null +++ b/personal-pkgs-repo/files/autopkg-common.mk @@ -0,0 +1,36 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-common.mk directly!") +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 + +TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) +GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare + +# Clone/update git history to bare repository +$(shell \ + if [ ! -d "$(TMP_REPO_PATH)" ]; then \ + git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ + else \ + git $(GIT_ARGS) remote update origin; \ + fi) + + +define AUTOPKG_TAIL + +PKG_SOURCE_PROTO:=git +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) + +undefine TMP_REPO_PATH +undefine GIT_ARGS +undefine AUTOPKG_TAIL + +endef diff --git a/personal-pkgs-repo/files/autopkg-tag.mk b/personal-pkgs-repo/files/autopkg-tag.mk new file mode 100644 index 0000000..6fe08d4 --- /dev/null +++ b/personal-pkgs-repo/files/autopkg-tag.mk @@ -0,0 +1,8 @@ +# Autopkg tracking latest version tag +AUTOPKG_VARIANT:=tag +$(call include_mk, autopkg-common.mk) + +PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) +PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) + +$(eval $(call AUTOPKG_TAIL)) -- cgit v1.2.3 From d83bde419809e1836983c8fead7185dfb7689b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 12:37:18 +0200 Subject: autopkg: split common --- personal-pkgs-repo/files/autopkg-branch.mk | 4 ++-- personal-pkgs-repo/files/autopkg-common.mk | 36 ------------------------------ personal-pkgs-repo/files/autopkg-head.mk | 21 +++++++++++++++++ personal-pkgs-repo/files/autopkg-tag.mk | 4 ++-- personal-pkgs-repo/files/autopkg-tail.mk | 13 +++++++++++ 5 files changed, 38 insertions(+), 40 deletions(-) delete mode 100644 personal-pkgs-repo/files/autopkg-common.mk create mode 100644 personal-pkgs-repo/files/autopkg-head.mk create mode 100644 personal-pkgs-repo/files/autopkg-tail.mk diff --git a/personal-pkgs-repo/files/autopkg-branch.mk b/personal-pkgs-repo/files/autopkg-branch.mk index 871cffb..c8791cc 100644 --- a/personal-pkgs-repo/files/autopkg-branch.mk +++ b/personal-pkgs-repo/files/autopkg-branch.mk @@ -1,6 +1,6 @@ # Autopkg tracking given branch AUTOPKG_VARIANT:=branch -$(call include_mk, autopkg-common.mk) +$(call include_mk, autopkg-head.mk) ifndef PKG_SOURCE_BRANCH $(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) @@ -21,4 +21,4 @@ PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOU PKG_VERSION:=$(PKG_VERSION:v%=%).9999 endif -$(eval $(call AUTOPKG_TAIL)) +$(call include_mk, autopkg-tail.mk) diff --git a/personal-pkgs-repo/files/autopkg-common.mk b/personal-pkgs-repo/files/autopkg-common.mk deleted file mode 100644 index c539e1a..0000000 --- a/personal-pkgs-repo/files/autopkg-common.mk +++ /dev/null @@ -1,36 +0,0 @@ -ifndef AUTOPKG_VARIANT - $(error "Don't include autopkg-common.mk directly!") -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 - -TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) -GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare - -# Clone/update git history to bare repository -$(shell \ - if [ ! -d "$(TMP_REPO_PATH)" ]; then \ - git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ - else \ - git $(GIT_ARGS) remote update origin; \ - fi) - - -define AUTOPKG_TAIL - -PKG_SOURCE_PROTO:=git -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) - -undefine TMP_REPO_PATH -undefine GIT_ARGS -undefine AUTOPKG_TAIL - -endef diff --git a/personal-pkgs-repo/files/autopkg-head.mk b/personal-pkgs-repo/files/autopkg-head.mk new file mode 100644 index 0000000..115e1ae --- /dev/null +++ b/personal-pkgs-repo/files/autopkg-head.mk @@ -0,0 +1,21 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-head.mk directly!") +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 + +TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) +GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare + +# Clone/update git history to bare repository +$(shell \ + if [ ! -d "$(TMP_REPO_PATH)" ]; then \ + git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ + else \ + git $(GIT_ARGS) remote update origin; \ + fi) diff --git a/personal-pkgs-repo/files/autopkg-tag.mk b/personal-pkgs-repo/files/autopkg-tag.mk index 6fe08d4..077c7ad 100644 --- a/personal-pkgs-repo/files/autopkg-tag.mk +++ b/personal-pkgs-repo/files/autopkg-tag.mk @@ -1,8 +1,8 @@ # Autopkg tracking latest version tag AUTOPKG_VARIANT:=tag -$(call include_mk, autopkg-common.mk) +$(call include_mk, autopkg-head.mk) PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) -$(eval $(call AUTOPKG_TAIL)) +$(call include_mk, autopkg-tail.mk) diff --git a/personal-pkgs-repo/files/autopkg-tail.mk b/personal-pkgs-repo/files/autopkg-tail.mk new file mode 100644 index 0000000..3b6d104 --- /dev/null +++ b/personal-pkgs-repo/files/autopkg-tail.mk @@ -0,0 +1,13 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-tail.mk directly!") +endif + +PKG_SOURCE_PROTO:=git +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) + +undefine TMP_REPO_PATH +undefine GIT_ARGS +undefine AUTOPKG_TAIL -- cgit v1.2.3 From a6abd46888c5780377786b50e7a1ca8812ab0960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 12:37:44 +0200 Subject: Packages fixes --- shellrc/Makefile | 1 + updater-ng/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/shellrc/Makefile b/shellrc/Makefile index 628dd9f..618343e 100644 --- a/shellrc/Makefile +++ b/shellrc/Makefile @@ -51,6 +51,7 @@ define Package/$(PKG_NAME)-zsh/install endef define Package/$(PKG_NAME)-ash/install + true # TODO #$(PKG_BUILD_DIR)/install --prefix "$(1)" --ash --no-base endef diff --git a/updater-ng/Makefile b/updater-ng/Makefile index 89ec3a2..5fba9a6 100644 --- a/updater-ng/Makefile +++ b/updater-ng/Makefile @@ -12,7 +12,7 @@ PKG_SOURCE_URL:=https://gitlab.labs.nic.cz/turris/updater.git PKG_SOURCE_BRANCH:=master PKG_MAINTAINER:=CZ.NIC HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host -PKG_BUILD_DEPENDS+=busybox-static +PKG_BUILD_DEPENDS:=busybox $(call include_mk, autopkg-branch.mk) include $(INCLUDE_DIR)/package.mk -- cgit v1.2.3 From 7a4e7809358548e24a5debb375e6e6a368247f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 12:42:30 +0200 Subject: autopkg: move it back --- autopkg-branch.mk | 24 ++++++++++++++++++++++++ autopkg-head.mk | 21 +++++++++++++++++++++ autopkg-tag.mk | 8 ++++++++ autopkg-tail.mk | 13 +++++++++++++ personal-pkgs-repo/files/autopkg-branch.mk | 24 ------------------------ personal-pkgs-repo/files/autopkg-head.mk | 21 --------------------- personal-pkgs-repo/files/autopkg-tag.mk | 8 -------- personal-pkgs-repo/files/autopkg-tail.mk | 13 ------------- shellrc/Makefile | 2 +- updater-ng/Makefile | 2 +- 10 files changed, 68 insertions(+), 68 deletions(-) create mode 100644 autopkg-branch.mk create mode 100644 autopkg-head.mk create mode 100644 autopkg-tag.mk create mode 100644 autopkg-tail.mk delete mode 100644 personal-pkgs-repo/files/autopkg-branch.mk delete mode 100644 personal-pkgs-repo/files/autopkg-head.mk delete mode 100644 personal-pkgs-repo/files/autopkg-tag.mk delete mode 100644 personal-pkgs-repo/files/autopkg-tail.mk diff --git a/autopkg-branch.mk b/autopkg-branch.mk new file mode 100644 index 0000000..9b587b3 --- /dev/null +++ b/autopkg-branch.mk @@ -0,0 +1,24 @@ +# Autopkg tracking given branch +AUTOPKG_VARIANT:=branch +include $(TOPDIR)/feeds/personal/autopkg-head.mk + +ifndef PKG_SOURCE_BRANCH +$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) +endif + +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)") + +ifeq ($(PKG_VERSION),) +# Count commits since initial commit. +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_SOURCE_VERSION)") +# No previous version found (no tag) so we use 9999 instead +PKG_VERSION:=9999 +else +# Count commits since last version tag +PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOURCE_VERSION)") +# .9999 is appended to not collide with possible existing package versions in repository +PKG_VERSION:=$(PKG_VERSION:v%=%).9999 +endif + +include $(TOPDIR)/feeds/personal/autopkg-tail.mk diff --git a/autopkg-head.mk b/autopkg-head.mk new file mode 100644 index 0000000..115e1ae --- /dev/null +++ b/autopkg-head.mk @@ -0,0 +1,21 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-head.mk directly!") +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 + +TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) +GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare + +# Clone/update git history to bare repository +$(shell \ + if [ ! -d "$(TMP_REPO_PATH)" ]; then \ + git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ + else \ + git $(GIT_ARGS) remote update origin; \ + fi) diff --git a/autopkg-tag.mk b/autopkg-tag.mk new file mode 100644 index 0000000..1524e2c --- /dev/null +++ b/autopkg-tag.mk @@ -0,0 +1,8 @@ +# Autopkg tracking latest version tag +AUTOPKG_VARIANT:=tag +include $(TOPDIR)/feeds/personal/autopkg-head.mk + +PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) +PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) + +include $(TOPDIR)/feeds/personal/autopkg-tail.mk diff --git a/autopkg-tail.mk b/autopkg-tail.mk new file mode 100644 index 0000000..3b6d104 --- /dev/null +++ b/autopkg-tail.mk @@ -0,0 +1,13 @@ +ifndef AUTOPKG_VARIANT + $(error "Don't include autopkg-tail.mk directly!") +endif + +PKG_SOURCE_PROTO:=git +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) + +undefine TMP_REPO_PATH +undefine GIT_ARGS +undefine AUTOPKG_TAIL diff --git a/personal-pkgs-repo/files/autopkg-branch.mk b/personal-pkgs-repo/files/autopkg-branch.mk deleted file mode 100644 index c8791cc..0000000 --- a/personal-pkgs-repo/files/autopkg-branch.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Autopkg tracking given branch -AUTOPKG_VARIANT:=branch -$(call include_mk, autopkg-head.mk) - -ifndef PKG_SOURCE_BRANCH -$(error You have to define PKG_SOURCE_BRANCH before pkgauto.mk include) -endif - -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)") - -ifeq ($(PKG_VERSION),) -# Count commits since initial commit. -PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_SOURCE_VERSION)") -# No previous version found (no tag) so we use 9999 instead -PKG_VERSION:=9999 -else -# Count commits since last version tag -PKG_RELEASE:=$(shell git $(GIT_ARGS) rev-list --count "$(PKG_VERSION)..$(PKG_SOURCE_VERSION)") -# .9999 is appended to not collide with possible existing package versions in repository -PKG_VERSION:=$(PKG_VERSION:v%=%).9999 -endif - -$(call include_mk, autopkg-tail.mk) diff --git a/personal-pkgs-repo/files/autopkg-head.mk b/personal-pkgs-repo/files/autopkg-head.mk deleted file mode 100644 index 115e1ae..0000000 --- a/personal-pkgs-repo/files/autopkg-head.mk +++ /dev/null @@ -1,21 +0,0 @@ -ifndef AUTOPKG_VARIANT - $(error "Don't include autopkg-head.mk directly!") -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 - -TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) -GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare - -# Clone/update git history to bare repository -$(shell \ - if [ ! -d "$(TMP_REPO_PATH)" ]; then \ - git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ - else \ - git $(GIT_ARGS) remote update origin; \ - fi) diff --git a/personal-pkgs-repo/files/autopkg-tag.mk b/personal-pkgs-repo/files/autopkg-tag.mk deleted file mode 100644 index 077c7ad..0000000 --- a/personal-pkgs-repo/files/autopkg-tag.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Autopkg tracking latest version tag -AUTOPKG_VARIANT:=tag -$(call include_mk, autopkg-head.mk) - -PKG_SOURCE_VERSION:=$(shell git $(GIT_ARGS) tag | grep '^v' | sort | tail -1) -PKG_VERSION:=$(subst v%,%,$(PKG_SOURCE_VERSION)) - -$(call include_mk, autopkg-tail.mk) diff --git a/personal-pkgs-repo/files/autopkg-tail.mk b/personal-pkgs-repo/files/autopkg-tail.mk deleted file mode 100644 index 3b6d104..0000000 --- a/personal-pkgs-repo/files/autopkg-tail.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifndef AUTOPKG_VARIANT - $(error "Don't include autopkg-tail.mk directly!") -endif - -PKG_SOURCE_PROTO:=git -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) - -undefine TMP_REPO_PATH -undefine GIT_ARGS -undefine AUTOPKG_TAIL diff --git a/shellrc/Makefile b/shellrc/Makefile index 618343e..1c6c5fd 100644 --- a/shellrc/Makefile +++ b/shellrc/Makefile @@ -12,7 +12,7 @@ PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.cynerd.cz/shellrc PKG_MAINTAINER:=Karel Kočí -$(call include_mk, autopkg-tag.mk) +include $(TOPDIR)/feeds/personal/autopkg-tag.mk include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) diff --git a/updater-ng/Makefile b/updater-ng/Makefile index 5fba9a6..17b8020 100644 --- a/updater-ng/Makefile +++ b/updater-ng/Makefile @@ -14,7 +14,7 @@ PKG_MAINTAINER:=CZ.NIC HOST_BUILD_DEPENDS:=curl/host libevent2/host lua/host PKG_BUILD_DEPENDS:=busybox -$(call include_mk, autopkg-branch.mk) +include $(TOPDIR)/feeds/personal/autopkg-branch.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk include $(TOPDIR)/feeds/packages/lang/python/python-package.mk -- cgit v1.2.3 From 9e6b567ec2c7eca1b0299b048c9f1872857b6579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 30 Aug 2018 12:54:03 +0200 Subject: shellrc: fix --- autopkg-head.mk | 4 ++-- shellrc/Makefile | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/autopkg-head.mk b/autopkg-head.mk index 115e1ae..a61c964 100644 --- a/autopkg-head.mk +++ b/autopkg-head.mk @@ -13,9 +13,9 @@ TMP_REPO_PATH=$(DL_DIR)/autopkg/$(PKG_NAME) GIT_ARGS=--git-dir='$(TMP_REPO_PATH)' --bare # Clone/update git history to bare repository -$(shell \ +$(info $(shell \ if [ ! -d "$(TMP_REPO_PATH)" ]; then \ git clone --mirror "$(PKG_SOURCE_URL)" "$(TMP_REPO_PATH)"; \ else \ git $(GIT_ARGS) remote update origin; \ - fi) + fi)) diff --git a/shellrc/Makefile b/shellrc/Makefile index 1c6c5fd..55f7dcb 100644 --- a/shellrc/Makefile +++ b/shellrc/Makefile @@ -57,3 +57,6 @@ define Package/$(PKG_NAME)-ash/install endef $(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)-bash)) +$(eval $(call BuildPackage,$(PKG_NAME)-zsh)) +$(eval $(call BuildPackage,$(PKG_NAME)-ash)) -- cgit v1.2.3