mirror of
https://git.yoctoproject.org/poky
synced 2026-09-13 00:49:33 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
c0a7913bfe
commit
e461f32d68
@@ -27,7 +27,7 @@ class LocalSigner(object):
|
||||
raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' %
|
||||
(keyid, output))
|
||||
|
||||
def sign_rpms(self, files, keyid, passphrase, digest, fsk=None, fsk_password=None):
|
||||
def sign_rpms(self, files, keyid, passphrase, digest, sign_chunk, fsk=None, fsk_password=None):
|
||||
"""Sign RPM files"""
|
||||
|
||||
cmd = self.rpm_bin + " --addsign --define '_gpg_name %s' " % keyid
|
||||
@@ -45,9 +45,9 @@ class LocalSigner(object):
|
||||
if fsk_password:
|
||||
cmd += "--define '_file_signing_key_password %s' " % fsk_password
|
||||
|
||||
# Sign packages
|
||||
for f in files:
|
||||
status, output = oe.utils.getstatusoutput(cmd + ' ' + f)
|
||||
# Sign in chunks
|
||||
for i in range(0, len(files), sign_chunk):
|
||||
status, output = oe.utils.getstatusoutput(cmd + ' '.join(files[i:i+sign_chunk]))
|
||||
if status:
|
||||
raise bb.build.FuncFailed("Failed to sign RPM packages: %s" % output)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user