summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:17:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:00 +0100
commita7309d5790f5dac46e84d3c14959943eb2496fda (patch)
tree48e1fcb886b8ef2974bade09694356f3230fb8a8 /meta/classes/insane.bbclass
parent297438e965053b2eb56cc8ef3e59465642f10a24 (diff)
downloadpoky-a7309d5790f5dac46e84d3c14959943eb2496fda.tar.gz
classes/lib: Update to use python3 command pipeline decoding
In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. (From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 71999ada34..9b2337cdbf 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -399,7 +399,7 @@ def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages)
399 sysroot_path_usr = sysroot_path + exec_prefix 399 sysroot_path_usr = sysroot_path + exec_prefix
400 400
401 try: 401 try:
402 ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read() 402 ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read().decode("utf-8")
403 except bb.process.CmdError: 403 except bb.process.CmdError:
404 error_msg = pn + ": prelink-rtld aborted when processing %s" % path 404 error_msg = pn + ": prelink-rtld aborted when processing %s" % path
405 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d) 405 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
@@ -986,12 +986,12 @@ def package_qa_check_expanded_d(path,name,d,elf,messages):
986 return sane 986 return sane
987 987
988def package_qa_check_encoding(keys, encode, d): 988def package_qa_check_encoding(keys, encode, d):
989 def check_encoding(key,enc): 989 def check_encoding(key, enc):
990 sane = True 990 sane = True
991 value = d.getVar(key, True) 991 value = d.getVar(key, True)
992 if value: 992 if value:
993 try: 993 try:
994 s = unicode(value, enc) 994 s = value.encode(enc)
995 except UnicodeDecodeError as e: 995 except UnicodeDecodeError as e:
996 error_msg = "%s has non %s characters" % (key,enc) 996 error_msg = "%s has non %s characters" % (key,enc)
997 sane = False 997 sane = False
@@ -1217,7 +1217,7 @@ Missing inherit gettext?""" % (gt, config))
1217 try: 1217 try:
1218 flag = "WARNING: unrecognized options:" 1218 flag = "WARNING: unrecognized options:"
1219 log = os.path.join(d.getVar('B', True), 'config.log') 1219 log = os.path.join(d.getVar('B', True), 'config.log')
1220 output = subprocess.check_output(['grep', '-F', flag, log]).replace(', ', ' ') 1220 output = subprocess.check_output(['grep', '-F', flag, log]).decode("utf-8").replace(', ', ' ')
1221 options = set() 1221 options = set()
1222 for line in output.splitlines(): 1222 for line in output.splitlines():
1223 options |= set(line.partition(flag)[2].split()) 1223 options |= set(line.partition(flag)[2].split())