summaryrefslogtreecommitdiffstats
path: root/meta/classes/insane.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r--meta/classes/insane.bbclass42
1 files changed, 12 insertions, 30 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b5c6b2186f..d6da53252f 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -174,7 +174,7 @@ def package_qa_check_useless_rpaths(file, name, d, elf, messages):
174 if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir): 174 if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir):
175 # The dynamic linker searches both these places anyway. There is no point in 175 # The dynamic linker searches both these places anyway. There is no point in
176 # looking there again. 176 # looking there again.
177 package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d), rpath)) 177 package_qa_add_message(messages, "useless-rpaths", "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d, name), rpath))
178 178
179QAPATHTEST[dev-so] = "package_qa_check_dev" 179QAPATHTEST[dev-so] = "package_qa_check_dev"
180def package_qa_check_dev(path, name, d, elf, messages): 180def package_qa_check_dev(path, name, d, elf, messages):
@@ -183,8 +183,8 @@ def package_qa_check_dev(path, name, d, elf, messages):
183 """ 183 """
184 184
185 if not name.endswith("-dev") and not name.endswith("-dbg") and not name.endswith("-ptest") and not name.startswith("nativesdk-") and path.endswith(".so") and os.path.islink(path): 185 if not name.endswith("-dev") and not name.endswith("-dbg") and not name.endswith("-ptest") and not name.startswith("nativesdk-") and path.endswith(".so") and os.path.islink(path):
186 package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package contains symlink .so: %s path '%s'" % \ 186 package_qa_add_message(messages, "dev-so", "non -dev/-dbg/nativesdk- package %s contains symlink .so '%s'" % \
187 (name, package_qa_clean_path(path,d))) 187 (name, package_qa_clean_path(path, d, name)))
188 188
189QAPATHTEST[dev-elf] = "package_qa_check_dev_elf" 189QAPATHTEST[dev-elf] = "package_qa_check_dev_elf"
190def package_qa_check_dev_elf(path, name, d, elf, messages): 190def package_qa_check_dev_elf(path, name, d, elf, messages):
@@ -194,8 +194,8 @@ def package_qa_check_dev_elf(path, name, d, elf, messages):
194 install link-time .so files that are linker scripts. 194 install link-time .so files that are linker scripts.
195 """ 195 """
196 if name.endswith("-dev") and path.endswith(".so") and not os.path.islink(path) and elf: 196 if name.endswith("-dev") and path.endswith(".so") and not os.path.islink(path) and elf:
197 package_qa_add_message(messages, "dev-elf", "-dev package contains non-symlink .so: %s path '%s'" % \ 197 package_qa_add_message(messages, "dev-elf", "-dev package %s contains non-symlink .so '%s'" % \
198 (name, package_qa_clean_path(path,d))) 198 (name, package_qa_clean_path(path, d, name)))
199 199
200QAPATHTEST[staticdev] = "package_qa_check_staticdev" 200QAPATHTEST[staticdev] = "package_qa_check_staticdev"
201def package_qa_check_staticdev(path, name, d, elf, messages): 201def package_qa_check_staticdev(path, name, d, elf, messages):
@@ -208,7 +208,7 @@ def package_qa_check_staticdev(path, name, d, elf, messages):
208 208
209 if not name.endswith("-pic") and not name.endswith("-staticdev") and not name.endswith("-ptest") and path.endswith(".a") and not path.endswith("_nonshared.a") and not '/usr/lib/debug-static/' in path and not '/.debug-static/' in path: 209 if not name.endswith("-pic") and not name.endswith("-staticdev") and not name.endswith("-ptest") and path.endswith(".a") and not path.endswith("_nonshared.a") and not '/usr/lib/debug-static/' in path and not '/.debug-static/' in path:
210 package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \ 210 package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
211 (name, package_qa_clean_path(path,d))) 211 (name, package_qa_clean_path(path,d, name)))
212 212
213QAPATHTEST[mime] = "package_qa_check_mime" 213QAPATHTEST[mime] = "package_qa_check_mime"
214def package_qa_check_mime(path, name, d, elf, messages): 214def package_qa_check_mime(path, name, d, elf, messages):
@@ -452,12 +452,14 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
452 """ 452 """
453 Check for build paths inside target files and error if not found in the whitelist 453 Check for build paths inside target files and error if not found in the whitelist
454 """ 454 """
455 import stat
455 # Ignore .debug files, not interesting 456 # Ignore .debug files, not interesting
456 if path.find(".debug") != -1: 457 if path.find(".debug") != -1:
457 return 458 return
458 459
459 # Ignore symlinks 460 # Ignore symlinks/devs/fifos
460 if os.path.islink(path): 461 mode = os.lstat(path).st_mode
462 if stat.S_ISLNK(mode) or stat.S_ISBLK(mode) or stat.S_ISFIFO(mode) or stat.S_ISCHR(mode) or stat.S_ISSOCK(mode):
461 return 463 return
462 464
463 tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8") 465 tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
@@ -945,7 +947,7 @@ def package_qa_check_host_user(path, name, d, elf, messages):
945 947
946 dest = d.getVar('PKGDEST') 948 dest = d.getVar('PKGDEST')
947 pn = d.getVar('PN') 949 pn = d.getVar('PN')
948 home = os.path.join(dest, 'home') 950 home = os.path.join(dest, name, 'home')
949 if path == home or path.startswith(home + os.sep): 951 if path == home or path.startswith(home + os.sep):
950 return 952 return
951 953
@@ -1012,26 +1014,6 @@ python do_package_qa () {
1012 logdir = d.getVar('T') 1014 logdir = d.getVar('T')
1013 pn = d.getVar('PN') 1015 pn = d.getVar('PN')
1014 1016
1015 # Check the compile log for host contamination
1016 compilelog = os.path.join(logdir,"log.do_compile")
1017
1018 if os.path.exists(compilelog):
1019 statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % compilelog
1020 if subprocess.call(statement, shell=True) == 0:
1021 msg = "%s: The compile log indicates that host include and/or library paths were used.\n \
1022 Please check the log '%s' for more information." % (pn, compilelog)
1023 package_qa_handle_error("compile-host-path", msg, d)
1024
1025 # Check the install log for host contamination
1026 installlog = os.path.join(logdir,"log.do_install")
1027
1028 if os.path.exists(installlog):
1029 statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % installlog
1030 if subprocess.call(statement, shell=True) == 0:
1031 msg = "%s: The install log indicates that host include and/or library paths were used.\n \
1032 Please check the log '%s' for more information." % (pn, installlog)
1033 package_qa_handle_error("install-host-path", msg, d)
1034
1035 # Scan the packages... 1017 # Scan the packages...
1036 pkgdest = d.getVar('PKGDEST') 1018 pkgdest = d.getVar('PKGDEST')
1037 packages = set((d.getVar('PACKAGES') or '').split()) 1019 packages = set((d.getVar('PACKAGES') or '').split())
@@ -1210,7 +1192,7 @@ python do_qa_configure() {
1210 if bb.data.inherits_class('autotools', d) and not skip_configure_unsafe: 1192 if bb.data.inherits_class('autotools', d) and not skip_configure_unsafe:
1211 bb.note("Checking autotools environment for common misconfiguration") 1193 bb.note("Checking autotools environment for common misconfiguration")
1212 for root, dirs, files in os.walk(workdir): 1194 for root, dirs, files in os.walk(workdir):
1213 statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \ 1195 statement = "grep -q -F -e 'is unsafe for cross-compilation' %s" % \
1214 os.path.join(root,"config.log") 1196 os.path.join(root,"config.log")
1215 if "config.log" in files: 1197 if "config.log" in files:
1216 if subprocess.call(statement, shell=True) == 0: 1198 if subprocess.call(statement, shell=True) == 0: