[OE-core] [PATCH 07/15] insane:add buildpaths QA ignore pattern

Hongxu Jia hongxu.jia at windriver.com
Fri Feb 26 01:44:54 UTC 2016


Add variable QA_BUILDPATHS_SKIP_PATTERN to ignore buildpaths QA
while filename (do not include directory) matches patterns,
the patterns are Unix shell style and separated by space.

[YOCTO #9169]
[YOCTO #7058]

Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
 meta/classes/insane.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 61936e1..57a3e42 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -592,11 +592,16 @@ def package_qa_hash_style(path, name, d, elf, messages):
         package_qa_add_message(messages, "ldflags", "No GNU_HASH in the elf binary: '%s'" % path)
 
 
+# Ignore buildpaths QA while filename (do not include directory)
+# matches patterns, patterns are Unix shell style and separated by space
+QA_BUILDPATHS_SKIP_PATTERN ??= "Makefile"
 QAPATHTEST[buildpaths] = "package_qa_check_buildpaths"
 def package_qa_check_buildpaths(path, name, d, elf, messages):
     """
     Check for build paths inside target files and error if not found in the whitelist
     """
+    from fnmatch import fnmatch
+
     # Ignore .debug files, not interesting
     if path.find(".debug") != -1:
         return
@@ -609,6 +614,14 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
     if path.find(name + "/CONTROL/") != -1 or path.find(name + "/DEBIAN/") != -1:
         return
 
+    # Ignore matched pattern file
+    ignores = d.getVar('QA_BUILDPATHS_SKIP_PATTERN', True).split()
+    file = os.path.basename(path)
+    for ignore in ignores:
+        if fnmatch(file, ignore):
+            bb.note("Package %s skipping buildpaths QA: %s" % (name, path))
+            return
+
     tmpdir = d.getVar('TMPDIR', True)
     with open(path) as f:
         file_content = f.read()
-- 
1.9.1




More information about the Openembedded-core mailing list