summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-07-12 14:44:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-30 00:02:52 +0100
commit884b88356259dfc3ec464adb1a8c6dda2ac4cf42 (patch)
tree807e2d41b149bd600495137844ec49f9b16d3151 /meta/classes
parent2919a89054c00e3d688ad8cb70b200283dd373d2 (diff)
downloadpoky-884b88356259dfc3ec464adb1a8c6dda2ac4cf42.tar.gz
insane: optimise buildpath search
Instead of decoding every file we open as UTF-8 (with many errors as machine code isn't UTF-8), convert the build path to the UTF-8 byte representation and search for that instead. (From OE-Core rev: ffb52d383bfe413cf31fef13663fe9937a146c76) (From OE-Core rev: e0e366731116e62857fa3bdec9e3897aafcc8137) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/insane.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index fa15460842..eb2d96711e 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -534,9 +534,9 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
534 if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1: 534 if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
535 return 535 return
536 536
537 tmpdir = d.getVar('TMPDIR') 537 tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
538 with open(path, 'rb') as f: 538 with open(path, 'rb') as f:
539 file_content = f.read().decode('utf-8', errors='ignore') 539 file_content = f.read()
540 if tmpdir in file_content: 540 if tmpdir in file_content:
541 package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)) 541 package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))
542 542