Skip to content
Snippets Groups Projects
Verified Commit 49b39aa2 authored by Karel Koci's avatar Karel Koci :metal: Committed by Michal Vasilek
Browse files

cznic-repo-keys: fix invalid name of key file

The usign has to be in build dependencies to actually use it. It is
possible that package would use `test.pub` as file name for OPKG due to
missing usign.
parent 911a0714
No related branches found
No related tags found
1 merge request!897cznic-repo-keys: fix invalid name of key file
# #
## Copyright (C) 2016 CZ.NIC z.s.p.o. (http://www.nic.cz/) ## Copyright (C) 2016-2022 CZ.NIC z.s.p.o. (http://www.nic.cz/)
# #
## This is free software, licensed under the GNU General Public License v2. ## This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
...@@ -8,10 +8,12 @@ ...@@ -8,10 +8,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=cznic-repo-keys PKG_NAME:=cznic-repo-keys
PKG_VERSION:=4.1 PKG_VERSION:=4.2
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MAINTAINER:=Michal Hrusecky <michal.hrusecky@nic.cz> PKG_MAINTAINER:=CZ.NIC <packaging@turris.cz>
PKG_BUILD_DEPENDS:=usign/host
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
...@@ -31,9 +33,10 @@ define Package/cznic-repo-keys/install ...@@ -31,9 +33,10 @@ define Package/cznic-repo-keys/install
$(INSTALL_DIR) $(1)/etc/opkg/keys $(INSTALL_DIR) $(1)/etc/opkg/keys
$(INSTALL_DIR) $(1)/etc/updater/keys/ $(INSTALL_DIR) $(1)/etc/updater/keys/
for i in release standby; do \ for i in release standby; do \
$(CP) files/$$$$i.pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub`; \ USIGNNAME="$$$$($(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub)"; \
$(CP) files/$$$$i.pub $(1)/etc/updater/keys; \ $(CP) files/$$$$i.pub $(1)/etc/opkg/keys/$$$$USIGNNAME; \
$(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys; \ $(CP) files/$$$$i.pub $(1)/etc/updater/keys/; \
$(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys/; \
done done
endef endef
...@@ -41,16 +44,17 @@ define Package/cznic-repo-keys-test/install ...@@ -41,16 +44,17 @@ define Package/cznic-repo-keys-test/install
$(INSTALL_DIR) $(1)/etc/opkg/keys $(INSTALL_DIR) $(1)/etc/opkg/keys
$(INSTALL_DIR) $(1)/etc/updater/keys/ $(INSTALL_DIR) $(1)/etc/updater/keys/
for i in test; do \ for i in test; do \
$(CP) files/$$$$i.pub $(1)/etc/opkg/keys/`$(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub`; \ USIGNNAME="$$$$($(STAGING_DIR_HOST)/bin/usign -F -p files/$$$$i.pub)"; \
$(CP) files/$$$$i.pub $(1)/etc/updater/keys; \ $(CP) files/$$$$i.pub $(1)/etc/opkg/keys/$$$$USIGNNAME; \
$(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys; \ $(CP) files/$$$$i.pub $(1)/etc/updater/keys/; \
$(CP) files/$$$$i.pub.sig $(1)/etc/updater/keys/; \
done done
endef endef
define Package/cznic-repo-keys/postinst define Package/cznic-repo-keys/postinst
#!/bin/sh #!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || { [ -n "$${IPKG_INSTROOT}" ] || {
# TODO: To remove files, use -r # NOTE: To remove files, use -r
/usr/sbin/cert-backup /etc/updater/keys/release.pub /etc/updater/keys/standby.pub /usr/sbin/cert-backup /etc/updater/keys/release.pub /etc/updater/keys/standby.pub
} }
endef endef
...@@ -58,7 +62,7 @@ endef ...@@ -58,7 +62,7 @@ endef
define Package/cznic-repo-keys-test/postinst define Package/cznic-repo-keys-test/postinst
#!/bin/sh #!/bin/sh
[ -n "$${IPKG_INSTROOT}" ] || { [ -n "$${IPKG_INSTROOT}" ] || {
# TODO: To remove files, use -r # NOTE: To remove files, use -r
/usr/sbin/cert-backup /etc/updater/keys/test.pub /usr/sbin/cert-backup /etc/updater/keys/test.pub
} }
endef endef
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment