]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane: optimise buildpath search
authorRoss Burton <ross.burton@intel.com>
Thu, 12 Jul 2018 13:44:06 +0000 (14:44 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Jul 2018 09:09:29 +0000 (10:09 +0100)
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.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/insane.bbclass

index 713b40eac42d4fc06a661b00ea703f8bd9018e37..469d5c4cd51d42ed60bce30a4f529c93e160d294 100644 (file)
@@ -535,9 +535,9 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
     if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
         return
 
-    tmpdir = d.getVar('TMPDIR')
+    tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
     with open(path, 'rb') as f:
-        file_content = f.read().decode('utf-8', errors='ignore')
+        file_content = f.read()
         if tmpdir in file_content:
             package_qa_add_message(messages, "buildpaths", "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d))