summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2007-02-19 17:18:29 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2007-02-19 17:18:29 +0000
commit00d65ea816431998476de087ca827f96efe3a84c (patch)
tree28a3ea6e7a1338972d81f792ce2e4088c5cb9d82
parent94fd1829fe6a460d185b4629e7bd7e7b34f29f60 (diff)
parente1268ca3f8a88713275e1697db3991de31905e20 (diff)
merge of '8d32cbe07454eff5b14e5fb3516faffd68cc9a72'
and 'f1b01b4d8de851be420cc84f9859d3c0a22ce1d5'
-rw-r--r--classes/insane.bbclass49
1 files changed, 43 insertions, 6 deletions
diff --git a/classes/insane.bbclass b/classes/insane.bbclass
index 0b2f8ee06c..166493691b 100644
--- a/classes/insane.bbclass
+++ b/classes/insane.bbclass
@@ -52,8 +52,8 @@ def package_qa_get_machine_dict():
"mipsel": ( 8, 0, 0, True),
},
"linux-gnueabi" : {
- "arm" : (40, 0, 0, True),
- },
+ "arm" : (40, 0, 0, True),
+ },
}
# factory for a class, embedded in a method
@@ -143,6 +143,8 @@ def package_qa_get_elf(path):
# 2 - package depends on debug package
# 3 - non dbg contains .so
# 4 - wrong architecture
+# 5 - .la contains installed=yes or reference to the workdir
+# 6 - .pc contains reference to /usr/include or workdir
#
#
@@ -172,6 +174,8 @@ def package_qa_write_error(error_class, name, path, d):
"package depends on debug package",
"non dbg contains .debug",
"wrong architecture",
+ "evil hides inside the .la",
+ "evil hides inside the .pc",
]
@@ -212,9 +216,9 @@ def package_qa_check_devdbg(path, name,d):
sane = True
if not "-dev" in name:
- if path[-3:] == ".so":
+ if path[-3:] == ".so" and os.path.islink(path):
package_qa_write_error( 0, name, path, d )
- bb.error("QA Issue: non dev package contains .so: %s path '%s'" % (name, package_qa_clean_path(path,d)))
+ bb.error("QA Issue: non -dev package %s contains symlink .so: %s path '%s'" % (name, package_qa_clean_path(path,d)))
if package_qa_make_fatal_error( 0, name, path, d ):
sane = False
@@ -278,8 +282,40 @@ def package_qa_check_staged(path,d):
"""
Check staged la and pc files for sanity
-e.g. installed being false
+
+ As this is run after every stage we should be able
+ to find the one responsible for the errors easily even
+ if we look at every .pc and .la file
"""
+ import os, bb
+
sane = True
+ workdir = os.path.join(bb.data.getVar('TMPDIR', d, True), "work")
+
+ if bb.data.inherits_class("native", d):
+ installed = "installed=no"
+ else:
+ installed = "installed=yes"
+
+ # find all .la and .pc files
+ # read the content
+ # and check for stuff that looks wrong
+ for root, dirs, files in os.walk(path):
+ for file in files:
+ path = os.path.join(root,file)
+ if file[-2:] == "la":
+ file_content = open(path).read()
+ if installed in file_content or workdir in file_content:
+ bb.error("QA issue: %s failed sanity test (reference to workdir or installed)" % file )
+ if package_qa_make_fatal_error( 5, "staging", path, d):
+ sane = False
+ elif file[-2:] == "pc":
+ file_content = open(path).read()
+ if "/usr/include" in file_content or workdir in file_content:
+ bb.error("QA issue: %s failed sanity test (reference to /usr/include or workdir)" % file )
+ if package_qa_make_fatal_error( 6, "staging", path, d):
+ sane = False
+
return sane
# Walk over all files in a directory and call func
@@ -364,9 +400,10 @@ python do_package_qa () {
# The Staging Func, to check all staging
addtask qa_staging after do_populate_staging before do_build
python do_qa_staging() {
- bb.note("Staged!")
+ bb.note("QA checking staging")
- package_qa_check_staged(bb.data.getVar('STAGING_DIR',d,True), d)
+ if not package_qa_check_staged(bb.data.getVar('STAGING_LIBDIR',d,True), d):
+ bb.fatal("QA staging was broken by the package built above")
}
# Check broken config.log files