diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2017-02-14 17:10:04 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-14 14:42:17 +0000 |
commit | 5a3e1290cbdeef4a8820201d78460a617ee638bd (patch) | |
tree | fd24762454a9ac0bbe6f46ac4add43e0d11de36c /meta/lib/oe | |
parent | f72bc777fa20422c8eaee5b592e9fe1f856623cd (diff) | |
download | poky-5a3e1290cbdeef4a8820201d78460a617ee638bd.tar.gz |
gpg_sign.py: fix signing of rpm files using gpg
This means
a) calling rpmkeys and rpmsign instead of rpm
b) instructing gpg to run non-interactively; otherwise on my machine
it pops up windows requesting a key passphrase
(From OE-Core rev: f82f270df2da59702026721612563aea57cd77eb)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/gpg_sign.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py index f7f96c6d5e..7ce767ee0a 100644 --- a/meta/lib/oe/gpg_sign.py +++ b/meta/lib/oe/gpg_sign.py | |||
@@ -11,7 +11,7 @@ class LocalSigner(object): | |||
11 | bb.utils.which(os.getenv('PATH'), 'gpg') | 11 | bb.utils.which(os.getenv('PATH'), 'gpg') |
12 | self.gpg_path = d.getVar('GPG_PATH') | 12 | self.gpg_path = d.getVar('GPG_PATH') |
13 | self.gpg_version = self.get_gpg_version() | 13 | self.gpg_version = self.get_gpg_version() |
14 | self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpm") | 14 | self.rpm_bin = bb.utils.which(os.getenv('PATH'), "rpmsign") |
15 | 15 | ||
16 | def export_pubkey(self, output_file, keyid, armor=True): | 16 | def export_pubkey(self, output_file, keyid, armor=True): |
17 | """Export GPG public key to a file""" | 17 | """Export GPG public key to a file""" |
@@ -31,9 +31,10 @@ class LocalSigner(object): | |||
31 | """Sign RPM files""" | 31 | """Sign RPM files""" |
32 | 32 | ||
33 | cmd = self.rpm_bin + " --addsign --define '_gpg_name %s' " % keyid | 33 | cmd = self.rpm_bin + " --addsign --define '_gpg_name %s' " % keyid |
34 | cmd += "--define '_gpg_passphrase %s' " % passphrase | 34 | gpg_args = '--batch --passphrase=%s' % passphrase |
35 | if self.gpg_version > (2,1,): | 35 | if self.gpg_version > (2,1,): |
36 | cmd += "--define '_gpg_sign_cmd_extra_args --pinentry-mode=loopback' " | 36 | gpg_args += ' --pinentry-mode=loopback' |
37 | cmd += "--define '_gpg_sign_cmd_extra_args %s' " % gpg_args | ||
37 | if self.gpg_bin: | 38 | if self.gpg_bin: |
38 | cmd += "--define '%%__gpg %s' " % self.gpg_bin | 39 | cmd += "--define '%%__gpg %s' " % self.gpg_bin |
39 | if self.gpg_path: | 40 | if self.gpg_path: |