]> code.ossystems Code Review - openembedded-core.git/commitdiff
sign_rpm.bbclass: do not set/use RPM_GPG_PUBKEY
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Wed, 22 Mar 2017 12:43:36 +0000 (14:43 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 Mar 2017 15:09:26 +0000 (15:09 +0000)
This is entirely unnecessary (we can ask the signer backend to export the
key to a file when needed), and was causing confusing selftest failures
due to the variable being set from two different places.

[YOCTO #11191]

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/sign_rpm.bbclass
meta/lib/oe/package_manager.py
meta/lib/oeqa/selftest/signing.py

index 2a08020819cdc0dcb5a95601edfab3dccf954e92..bc2e947107c444a2e4b330849c8df6c42ba8d65c 100644 (file)
@@ -28,13 +28,6 @@ python () {
     for var in ('RPM_GPG_NAME', 'RPM_GPG_PASSPHRASE'):
         if not d.getVar(var):
             raise_sanity_error("You need to define %s in the config" % var, d)
-
-    # Set the expected location of the public key
-    d.setVar('RPM_GPG_PUBKEY', os.path.join(d.getVar('STAGING_DIR_TARGET', False),
-                                            d.getVar('sysconfdir', False),
-                                            'pki',
-                                            'rpm-gpg',
-                                            'RPM-GPG-KEY-${DISTRO_VERSION}'))
 }
 
 python sign_rpm () {
index 2a4df619982d7a4d5935f9d46ebf74b035562d55..8b2b33106e107a060925dabd924e04056d3b2f08 100644 (file)
@@ -520,7 +520,9 @@ class RpmPM(PackageManager):
             open(platformconfdir + "macros", 'a').write("%_prefer_color 7")
 
         if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
-            pubkey_path = self.d.getVar('RPM_GPG_PUBKEY')
+            signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))
+            pubkey_path = oe.path.join(self.d.getVar('B'), 'rpm-key')
+            signer.export_pubkey(pubkey_path, self.d.getVar('RPM_GPG_NAME'))
             rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmkeys")
             cmd = [rpm_bin, '--root=%s' % self.target_rootfs, '--import', pubkey_path]
             try:
index c1dd801400952c99d78a74f68a0eb03bafc9a25a..0ac3d1fac98d2497a41eecc54fc1d78f1264da0c 100644 (file)
@@ -51,7 +51,6 @@ class Signing(oeSelfTest):
         feature = 'INHERIT += "sign_rpm"\n'
         feature += 'RPM_GPG_PASSPHRASE = "test123"\n'
         feature += 'RPM_GPG_NAME = "testuser"\n'
-        feature += 'RPM_GPG_PUBKEY = "%s"\n' % self.pub_key_path
         feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
 
         self.write_config(feature)