summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2012-01-05 13:12:50 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-05 22:17:33 +0000
commit05409821ea58915c38a0962fb4dd14f8a49806e6 (patch)
tree52f08a8085b3bf6456a7c78c454439054634fda0
parent7f837eb05f924996c89283ec8b74e46f6b5cd343 (diff)
downloadpoky-05409821ea58915c38a0962fb4dd14f8a49806e6.tar.gz
insane.bbclass: use bb.process.Popen instead of subprocess.check_output
subprocess.check_output was only introduced in Python v2.7, so we cannot use it. This refactors the QA test to use bb.process.Popen instead. This fixes the error: AttributeError: 'module' object has no attribute 'check_output' It no longer checks the return status of prelink-rtld, as that case was simply adding noise. This QA test is intended to only warn about specific paths that binaries could be linking to, not handle the case where there is a missing library. (From OE-Core rev: 0443487fe0bc628db9b03306bdc9dcdb39a121dc) Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/insane.bbclass16
1 files changed, 6 insertions, 10 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b8d45073ef..8d6b11c1cf 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -227,16 +227,12 @@ def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages)
227 sysroot_path_usr = sysroot_path + exec_prefix 227 sysroot_path_usr = sysroot_path + exec_prefix
228 228
229 try: 229 try:
230 ldd_output = sub.check_output(["prelink-rtld", "--root", sysroot_path, path]) 230 ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read()
231 except sub.CalledProcessError as e: 231 except bb.process.CmdError:
232 if e.returncode != 127: 232 error_msg = pn + ": prelink-rtld aborted when processing %s" % path
233 error_msg = pn + ": prelink-rtld aborted when processing %s" % path 233 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
234 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d) 234 return False
235 return False 235
236 else:
237 # Sometimes this is done deliberately (e.g, e2fsprogs), so only warn
238 bb.warn("%s has missing library dependencies" % path)
239 return
240 if sysroot_path_usr in ldd_output: 236 if sysroot_path_usr in ldd_output:
241 error_msg = pn + ": %s links to something under exec_prefix" % path 237 error_msg = pn + ": %s links to something under exec_prefix" % path
242 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d) 238 package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)