summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/meta')
-rw-r--r--meta/recipes-core/meta/signing-keys.bb26
1 files changed, 12 insertions, 14 deletions
diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb
index cc401f3b6c..d7aa79d49f 100644
--- a/meta/recipes-core/meta/signing-keys.bb
+++ b/meta/recipes-core/meta/signing-keys.bb
@@ -20,26 +20,24 @@ do_populate_sysroot[noexec] = "1"
20 20
21EXCLUDE_FROM_WORLD = "1" 21EXCLUDE_FROM_WORLD = "1"
22 22
23def export_gpg_pubkey(d, keyid, path):
24 import bb
25 gpg_bin = d.getVar('GPG_BIN', True) or \
26 bb.utils.which(os.getenv('PATH'), "gpg")
27 cmd = '%s --batch --yes --export --armor -o %s %s' % \
28 (gpg_bin, path, keyid)
29 status, output = oe.utils.getstatusoutput(cmd)
30 if status:
31 raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' %
32 (keyid, output))
33 23
34python do_export_public_keys () { 24python do_export_public_keys () {
25 from oe.gpg_sign import get_signer
26
35 if d.getVar("RPM_SIGN_PACKAGES", True): 27 if d.getVar("RPM_SIGN_PACKAGES", True):
36 # Export public key of the rpm signing key 28 # Export public key of the rpm signing key
37 export_gpg_pubkey(d, d.getVar("RPM_GPG_NAME", True), 29 signer = get_signer(d,
38 d.getVar('RPM_GPG_PUBKEY', True)) 30 d.getVar('RPM_GPG_BACKEND', True),
31 d.getVar('RPM_GPG_NAME', True),
32 d.getVar('RPM_GPG_PASSPHRASE_FILE', True))
33 signer.export_pubkey(d.getVar('RPM_GPG_PUBKEY', True))
39 34
40 if d.getVar('PACKAGE_FEED_SIGN', True) == '1': 35 if d.getVar('PACKAGE_FEED_SIGN', True) == '1':
41 # Export public key of the feed signing key 36 # Export public key of the feed signing key
42 export_gpg_pubkey(d, d.getVar("PACKAGE_FEED_GPG_NAME", True), 37 signer = get_signer(d,
43 d.getVar('PACKAGE_FEED_GPG_PUBKEY', True)) 38 d.getVar('PACKAGE_FEED_GPG_BACKEND', True),
39 d.getVar('PACKAGE_FEED_GPG_NAME', True),
40 d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True))
41 signer.export_pubkey(d.getVar('PACKAGE_FEED_GPG_PUBKEY', True))
44} 42}
45addtask do_export_public_keys before do_build 43addtask do_export_public_keys before do_build