oe/gpg_sign: add 'armor' argument to detach_sign()

[YOCTO #9006]

(From OE-Core rev: ce653694a87fd77d79ec3d28ed3365a2c8e57ad6)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen 2016-02-10 16:15:56 +02:00 committed by Richard Purdie
parent 03554b77cd
commit d5be8666a1
1 changed files with 4 additions and 2 deletions

View File

@ -52,13 +52,15 @@ class LocalSigner(object):
bb.error('rpmsign failed: %s' % proc.before.strip())
raise bb.build.FuncFailed("Failed to sign RPM packages")
def detach_sign(self, input_file):
def detach_sign(self, input_file, armor=True):
"""Create a detached signature of a file"""
cmd = "%s --detach-sign --armor --batch --no-tty --yes " \
cmd = "%s --detach-sign --batch --no-tty --yes " \
"--passphrase-file '%s' -u '%s' " % \
(self.gpg_bin, self.passphrase_file, self.keyid)
if self.gpg_path:
cmd += "--homedir %s " % self.gpg_path
if armor:
cmd += "--armor "
cmd += input_file
status, output = oe.utils.getstatusoutput(cmd)
if status: