mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 13:29:49 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
1f2f43c5b0
commit
a2bf9e39b6
@@ -318,6 +318,9 @@ def package_qa_check_libdir(d):
|
|||||||
|
|
||||||
messages = []
|
messages = []
|
||||||
|
|
||||||
|
# The re's are purposely fuzzy, as some there are some .so.x.y.z files
|
||||||
|
# that don't follow the standard naming convention. It checks later
|
||||||
|
# that they are actual ELF files
|
||||||
lib_re = re.compile("^/lib.+\.so(\..+)?$")
|
lib_re = re.compile("^/lib.+\.so(\..+)?$")
|
||||||
exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix)
|
exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix)
|
||||||
|
|
||||||
@@ -342,10 +345,22 @@ def package_qa_check_libdir(d):
|
|||||||
rel_path = os.sep + rel_path
|
rel_path = os.sep + rel_path
|
||||||
if lib_re.match(rel_path):
|
if lib_re.match(rel_path):
|
||||||
if base_libdir not in rel_path:
|
if base_libdir not in rel_path:
|
||||||
messages.append("%s: found library in wrong location: %s" % (package, rel_path))
|
# make sure it's an actual ELF file
|
||||||
|
elf = oe.qa.ELFFile(full_path)
|
||||||
|
try:
|
||||||
|
elf.open()
|
||||||
|
messages.append("%s: found library in wrong location: %s" % (package, rel_path))
|
||||||
|
except (oe.qa.NotELFFileError):
|
||||||
|
pass
|
||||||
if exec_re.match(rel_path):
|
if exec_re.match(rel_path):
|
||||||
if libdir not in rel_path and libexecdir not in rel_path:
|
if libdir not in rel_path and libexecdir not in rel_path:
|
||||||
messages.append("%s: found library in wrong location: %s" % (package, rel_path))
|
# make sure it's an actual ELF file
|
||||||
|
elf = oe.qa.ELFFile(full_path)
|
||||||
|
try:
|
||||||
|
elf.open()
|
||||||
|
messages.append("%s: found library in wrong location: %s" % (package, rel_path))
|
||||||
|
except (oe.qa.NotELFFileError):
|
||||||
|
pass
|
||||||
|
|
||||||
if messages:
|
if messages:
|
||||||
package_qa_handle_error("libdir", "\n".join(messages), d)
|
package_qa_handle_error("libdir", "\n".join(messages), d)
|
||||||
|
|||||||
Reference in New Issue
Block a user