diff options
author | Bill Randle <william.c.randle@intel.com> | 2016-04-01 09:49:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-03 15:51:36 +0100 |
commit | a2bf9e39b62eee203865cbc0e9890d98a6f57243 (patch) | |
tree | 29316f207ad6e45499e62ca65576379bb66d4038 | |
parent | 1f2f43c5b08a449c963109332ac91653a9f3f5ef (diff) | |
download | poky-a2bf9e39b62eee203865cbc0e9890d98a6f57243.tar.gz |
insane.bbclass: avoid false positives on library location
package_qa_check_libdir() reports that the file libsoletta.so.0.0.1-gdb.py
in /usr/share/gdb/auto-load is in the wrong location. Before generating
a warning for files in non-standard locations, check that the file is an
actual elf file (and hence a real library file).
[YOCTO #9215]
(From OE-Core rev: a3ad36b9a435e7c3d97f114809561198b8abe6cf)
Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/insane.bbclass | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 7ac945d4cd..c57b21735d 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -318,6 +318,9 @@ def package_qa_check_libdir(d): | |||
318 | 318 | ||
319 | messages = [] | 319 | messages = [] |
320 | 320 | ||
321 | # The re's are purposely fuzzy, as some there are some .so.x.y.z files | ||
322 | # that don't follow the standard naming convention. It checks later | ||
323 | # that they are actual ELF files | ||
321 | lib_re = re.compile("^/lib.+\.so(\..+)?$") | 324 | lib_re = re.compile("^/lib.+\.so(\..+)?$") |
322 | exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix) | 325 | exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix) |
323 | 326 | ||
@@ -342,10 +345,22 @@ def package_qa_check_libdir(d): | |||
342 | rel_path = os.sep + rel_path | 345 | rel_path = os.sep + rel_path |
343 | if lib_re.match(rel_path): | 346 | if lib_re.match(rel_path): |
344 | if base_libdir not in rel_path: | 347 | if base_libdir not in rel_path: |
345 | messages.append("%s: found library in wrong location: %s" % (package, rel_path)) | 348 | # make sure it's an actual ELF file |
349 | elf = oe.qa.ELFFile(full_path) | ||
350 | try: | ||
351 | elf.open() | ||
352 | messages.append("%s: found library in wrong location: %s" % (package, rel_path)) | ||
353 | except (oe.qa.NotELFFileError): | ||
354 | pass | ||
346 | if exec_re.match(rel_path): | 355 | if exec_re.match(rel_path): |
347 | if libdir not in rel_path and libexecdir not in rel_path: | 356 | if libdir not in rel_path and libexecdir not in rel_path: |
348 | messages.append("%s: found library in wrong location: %s" % (package, rel_path)) | 357 | # make sure it's an actual ELF file |
358 | elf = oe.qa.ELFFile(full_path) | ||
359 | try: | ||
360 | elf.open() | ||
361 | messages.append("%s: found library in wrong location: %s" % (package, rel_path)) | ||
362 | except (oe.qa.NotELFFileError): | ||
363 | pass | ||
349 | 364 | ||
350 | if messages: | 365 | if messages: |
351 | package_qa_handle_error("libdir", "\n".join(messages), d) | 366 | package_qa_handle_error("libdir", "\n".join(messages), d) |