summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/gpg_sign.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/gpg_sign.py')
-rw-r--r--meta/lib/oe/gpg_sign.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index b83ee86728..a8a478aa95 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -24,7 +24,7 @@ class LocalSigner(object):
24 status, output = oe.utils.getstatusoutput(cmd) 24 status, output = oe.utils.getstatusoutput(cmd)
25 if status: 25 if status:
26 raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' % 26 raise bb.build.FuncFailed('Failed to export gpg public key (%s): %s' %
27 (keyid, output)) 27 (keyid, output.decode("utf-8")))
28 28
29 def sign_rpms(self, files, keyid, passphrase): 29 def sign_rpms(self, files, keyid, passphrase):
30 """Sign RPM files""" 30 """Sign RPM files"""
@@ -39,7 +39,7 @@ class LocalSigner(object):
39 39
40 status, output = oe.utils.getstatusoutput(cmd) 40 status, output = oe.utils.getstatusoutput(cmd)
41 if status: 41 if status:
42 raise bb.build.FuncFailed("Failed to sign RPM packages: %s" % output) 42 raise bb.build.FuncFailed("Failed to sign RPM packages: %s" % output.decode("utf-8"))
43 43
44 def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True): 44 def detach_sign(self, input_file, keyid, passphrase_file, passphrase=None, armor=True):
45 """Create a detached signature of a file""" 45 """Create a detached signature of a file"""
@@ -71,11 +71,11 @@ class LocalSigner(object):
71 passphrase = fobj.readline(); 71 passphrase = fobj.readline();
72 72
73 job = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE) 73 job = subprocess.Popen(cmd, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
74 (_, stderr) = job.communicate(passphrase) 74 (_, stderr) = job.communicate(passphrase.encode("utf-8"))
75 75
76 if job.returncode: 76 if job.returncode:
77 raise bb.build.FuncFailed("GPG exited with code %d: %s" % 77 raise bb.build.FuncFailed("GPG exited with code %d: %s" %
78 (job.returncode, stderr)) 78 (job.returncode, stderr.decode("utf-8")))
79 79
80 except IOError as e: 80 except IOError as e:
81 bb.error("IO error (%s): %s" % (e.errno, e.strerror)) 81 bb.error("IO error (%s): %s" % (e.errno, e.strerror))
@@ -90,7 +90,7 @@ class LocalSigner(object):
90 """Return the gpg version""" 90 """Return the gpg version"""
91 import subprocess 91 import subprocess
92 try: 92 try:
93 return subprocess.check_output((self.gpg_bin, "--version")).split()[2] 93 return subprocess.check_output((self.gpg_bin, "--version")).split()[2].decode("utf-8")
94 except subprocess.CalledProcessError as e: 94 except subprocess.CalledProcessError as e:
95 raise bb.build.FuncFailed("Could not get gpg version: %s" % e) 95 raise bb.build.FuncFailed("Could not get gpg version: %s" % e)
96 96