summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2017-03-22 14:43:36 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-23 13:19:49 +0000
commit4581e2c3e65178c3fb38cc0598382c69914abe51 (patch)
treea0bc64aa95db63e165adfa8a7b22065113686443
parent0a435c7e6ac88c5e099b12f6a90cd96155fe18f2 (diff)
downloadpoky-4581e2c3e65178c3fb38cc0598382c69914abe51.tar.gz
sign_rpm.bbclass: do not set/use RPM_GPG_PUBKEY
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] (From OE-Core rev: 74ea979044368dc28c24325e7e77471b70aa8fe8) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sign_rpm.bbclass7
-rw-r--r--meta/lib/oe/package_manager.py4
-rw-r--r--meta/lib/oeqa/selftest/signing.py1
3 files changed, 3 insertions, 9 deletions
diff --git a/meta/classes/sign_rpm.bbclass b/meta/classes/sign_rpm.bbclass
index 2a08020819..bc2e947107 100644
--- a/meta/classes/sign_rpm.bbclass
+++ b/meta/classes/sign_rpm.bbclass
@@ -28,13 +28,6 @@ python () {
28 for var in ('RPM_GPG_NAME', 'RPM_GPG_PASSPHRASE'): 28 for var in ('RPM_GPG_NAME', 'RPM_GPG_PASSPHRASE'):
29 if not d.getVar(var): 29 if not d.getVar(var):
30 raise_sanity_error("You need to define %s in the config" % var, d) 30 raise_sanity_error("You need to define %s in the config" % var, d)
31
32 # Set the expected location of the public key
33 d.setVar('RPM_GPG_PUBKEY', os.path.join(d.getVar('STAGING_DIR_TARGET', False),
34 d.getVar('sysconfdir', False),
35 'pki',
36 'rpm-gpg',
37 'RPM-GPG-KEY-${DISTRO_VERSION}'))
38} 31}
39 32
40python sign_rpm () { 33python sign_rpm () {
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2a4df61998..8b2b33106e 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -520,7 +520,9 @@ class RpmPM(PackageManager):
520 open(platformconfdir + "macros", 'a').write("%_prefer_color 7") 520 open(platformconfdir + "macros", 'a').write("%_prefer_color 7")
521 521
522 if self.d.getVar('RPM_SIGN_PACKAGES') == '1': 522 if self.d.getVar('RPM_SIGN_PACKAGES') == '1':
523 pubkey_path = self.d.getVar('RPM_GPG_PUBKEY') 523 signer = get_signer(self.d, self.d.getVar('RPM_GPG_BACKEND'))
524 pubkey_path = oe.path.join(self.d.getVar('B'), 'rpm-key')
525 signer.export_pubkey(pubkey_path, self.d.getVar('RPM_GPG_NAME'))
524 rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmkeys") 526 rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmkeys")
525 cmd = [rpm_bin, '--root=%s' % self.target_rootfs, '--import', pubkey_path] 527 cmd = [rpm_bin, '--root=%s' % self.target_rootfs, '--import', pubkey_path]
526 try: 528 try:
diff --git a/meta/lib/oeqa/selftest/signing.py b/meta/lib/oeqa/selftest/signing.py
index c1dd801400..0ac3d1fac9 100644
--- a/meta/lib/oeqa/selftest/signing.py
+++ b/meta/lib/oeqa/selftest/signing.py
@@ -51,7 +51,6 @@ class Signing(oeSelfTest):
51 feature = 'INHERIT += "sign_rpm"\n' 51 feature = 'INHERIT += "sign_rpm"\n'
52 feature += 'RPM_GPG_PASSPHRASE = "test123"\n' 52 feature += 'RPM_GPG_PASSPHRASE = "test123"\n'
53 feature += 'RPM_GPG_NAME = "testuser"\n' 53 feature += 'RPM_GPG_NAME = "testuser"\n'
54 feature += 'RPM_GPG_PUBKEY = "%s"\n' % self.pub_key_path
55 feature += 'GPG_PATH = "%s"\n' % self.gpg_dir 54 feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
56 55
57 self.write_config(feature) 56 self.write_config(feature)