summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-08-17 10:12:27 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-08-18 23:46:37 +0100
commite461f32d6823aeecbe3ee8090588737c9d67e91f (patch)
tree8e510c444a4c62b5b84e1b2fa9ce2a0f6682911b /meta/lib
parentc0a7913bfe784f011b50b172cfe37c2002888043 (diff)
downloadpoky-e461f32d6823aeecbe3ee8090588737c9d67e91f.tar.gz
sign_rpm: Allow pkg signing by chunks through RPM_GPG_SIGN_CHUNK
Commit d58b1d196 moved from chunk to serial signing, but neither of both approaches allowed the user to select the chunks size. This patch allows the user to select a chunk size through RPM_GPG_SIGN_CHUNK defaulting to BB_NUMBER_THREADS, considered a good default. Indirectly, this change reduces the number of processes spawn to number-of-packages/RPM_GPG_SIGN_CHUNK. (From OE-Core rev: f7f78e73f1cd15f4233a231364b14438af758628) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/gpg_sign.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 5c7985a856..008478dfeb 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -27,7 +27,7 @@ class LocalSigner(object):
27 raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' % 27 raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' %
28 (keyid, output)) 28 (keyid, output))
29 29
30 def sign_rpms(self, files, keyid, passphrase, digest, fsk=None, fsk_password=None): 30 def sign_rpms(self, files, keyid, passphrase, digest, sign_chunk, fsk=None, fsk_password=None):
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
@@ -45,9 +45,9 @@ class LocalSigner(object):
45 if fsk_password: 45 if fsk_password:
46 cmd += "--define '_file_signing_key_password %s' " % fsk_password 46 cmd += "--define '_file_signing_key_password %s' " % fsk_password
47 47
48 # Sign packages 48 # Sign in chunks
49 for f in files: 49 for i in range(0, len(files), sign_chunk):
50 status, output = oe.utils.getstatusoutput(cmd + ' ' + f) 50 status, output = oe.utils.getstatusoutput(cmd + ' '.join(files[i:i+sign_chunk]))
51 if status: 51 if status:
52 raise bb.build.FuncFailed("Failed to sign RPM packages: %s" % output) 52 raise bb.build.FuncFailed("Failed to sign RPM packages: %s" % output)
53 53