[OE-core] [PATCHv2 35/39] gpg_sign.py: fix rpm signing with gpg > 2.1

Alexander Kanavin alexander.kanavin at linux.intel.com
Tue Feb 21 14:46:52 UTC 2017


From: Markus Lehtonen <markus.lehtonen at linux.intel.com>

We need to check the gpg version and alter its command line options
accordingly.

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Signed-off-by: Alexander Kanavin <alexander.kanavin at linux.intel.com>
---
 meta/lib/oe/gpg_sign.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 725da5a2a5d..10272be4c9a 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -31,7 +31,10 @@ class LocalSigner(object):
         """Sign RPM files"""
 
         cmd = self.rpm_bin + " --addsign --define '_gpg_name %s'  " % keyid
-        cmd += "--define '_gpg_sign_cmd_extra_args --batch --passphrase=%s --pinentry-mode=loopback' " % passphrase
+        gpg_args = '--batch --passphrase=%s' % passphrase
+        if self.gpg_version > (2,1,):
+            gpg_args += ' --pinentry-mode=loopback'
+        cmd += "--define '_gpg_sign_cmd_extra_args %s' " % gpg_args
         if self.gpg_bin:
             cmd += "--define '%%__gpg %s' " % self.gpg_bin
         if self.gpg_path:
-- 
2.11.0




More information about the Openembedded-core mailing list