]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
insane: handle dangling symlinks in the libdir QA check
authorRoss Burton <ross.burton@arm.com>
Tue, 30 Apr 2024 13:57:16 +0000 (13:57 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 May 2024 14:10:34 +0000 (15:10 +0100)
The "libdir" QA check tries to open every file it finds as an ELF.  If
it finds a dangling symlink that looks like a library by the filename it
will try to open it and fail with FileNotFoundError error.  As this
dangling symlink probably points to a real file, silently absorb the
error.

[ YOCTO #13949 ]

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass

index e963001d09accfc0cb765c611460fd233ceb8805..c32dfffd836d7b12ba6fbc1b32c12c83c2a1c3cd 100644 (file)
@@ -298,7 +298,7 @@ def package_qa_check_libdir(d):
                         try:
                             elf.open()
                             messages.append("%s: found library in wrong location: %s" % (package, rel_path))
-                        except (oe.qa.NotELFFileError):
+                        except (oe.qa.NotELFFileError, FileNotFoundError):
                             pass
                 if exec_re.match(rel_path):
                     if libdir not in rel_path and libexecdir not in rel_path:
@@ -307,7 +307,7 @@ def package_qa_check_libdir(d):
                         try:
                             elf.open()
                             messages.append("%s: found library in wrong location: %s" % (package, rel_path))
-                        except (oe.qa.NotELFFileError):
+                        except (oe.qa.NotELFFileError, FileNotFoundError):
                             pass
 
     if messages: