From 393b80fa358557bd24dde6a0b7052fcb87eb32d7 Mon Sep 17 00:00:00 2001 From: Sandy <39258624+sandy-lcq@users.noreply.github.com> Date: Thu, 7 Nov 2019 17:31:03 +0800 Subject: sign_rpm_ext.bbclass: fix check_rpm_public_key failed while host not install gpg (#124) Due to the following reasons, need to add the dependency to task who needs to run check_rpm_public_key: * packagegroup recipe don't have task prepare_recipe_sysroot * varflags depends don't work for prefuncs Signed-off-by: Changqing Li --- meta-integrity/classes/sign_rpm_ext.bbclass | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/meta-integrity/classes/sign_rpm_ext.bbclass b/meta-integrity/classes/sign_rpm_ext.bbclass index a8362ef..d9a7f34 100644 --- a/meta-integrity/classes/sign_rpm_ext.bbclass +++ b/meta-integrity/classes/sign_rpm_ext.bbclass @@ -10,8 +10,7 @@ RPM_FSK_PASSWORD ?= "password" inherit sign_rpm user-key-store -GPG_DEP = "${@'' if d.getVar('GPG_BIN') else 'gnupg-native pinentry-native'}" -DEPENDS_append_class-target += "${GPG_DEP}" +GPG_DEP = "${@'' if d.getVar('GPG_BIN') else 'gnupg-native:do_populate_sysroot pinentry-native:do_populate_sysroot'}" python check_rpm_public_key () { gpg_path = d.getVar('GPG_PATH', True) @@ -35,9 +34,17 @@ python check_rpm_public_key () { bb.fatal('Failed to import gpg key (%s): %s' % (gpg_key, output)) } check_rpm_public_key[lockfiles] = "${TMPDIR}/check_rpm_public_key.lock" -do_package_write_rpm[prefuncs] += "check_rpm_public_key" -do_rootfs[prefuncs] += "check_rpm_public_key" check_rpm_public_key[prefuncs] += "check_deploy_keys" +do_package_write_rpm[depends] += "${GPG_DEP}" +do_rootfs[depends] += "${GPG_DEP}" + +python do_package_write_rpm_prepend() { + bb.build.exec_func("check_rpm_public_key", d) +} + +python do_rootfs_prepend() { + bb.build.exec_func("check_rpm_public_key", d) +} python () { gpg_path = d.getVar('GPG_PATH', True) -- cgit v1.2.3-54-g00ecf