]> code.ossystems Code Review - openembedded-core.git/commitdiff
gpg_sign: export_pubkey: add signature type support
authorIoan-Adrian Ratiu <adrian.ratiu@ni.com>
Thu, 10 Mar 2016 10:02:57 +0000 (12:02 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Mar 2016 16:50:27 +0000 (16:50 +0000)
Add support for multiple types of signatures (binary or ascii)
in export_pubkey(). There is no change in behaviour for the function,
the previous implicit default is the new parameter "armor" default.

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/gpg_sign.py

index 0b5dc20892bc02574a6fee38840730ee107b6473..e738397880b92b5a73710c195da60dda26c83cca 100644 (file)
@@ -12,12 +12,14 @@ class LocalSigner(object):
         self.gpg_path = d.getVar('GPG_PATH', True)
         self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpm")
 
-    def export_pubkey(self, output_file, keyid):
+    def export_pubkey(self, output_file, keyid, armor=True):
         """Export GPG public key to a file"""
-        cmd = '%s --batch --yes --export --armor -o %s ' % \
+        cmd = '%s --batch --yes --export -o %s ' % \
                 (self.gpg_bin, output_file)
         if self.gpg_path:
             cmd += "--homedir %s " % self.gpg_path
+        if armor:
+            cmd += "--armor "
         cmd += keyid
         status, output = oe.utils.getstatusoutput(cmd)
         if status: