]> code.ossystems Code Review - openembedded-core.git/commitdiff
insane: only load real files as ELF
authorRoss Burton <ross@burtonini.com>
Thu, 3 Sep 2020 12:43:19 +0000 (13:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 5 Sep 2020 21:18:12 +0000 (22:18 +0100)
The file path checks are passed an ELF object if the file is an ELF. It
doesn't make a lot of sense to load symlinks to ELFs as if they're in
the same package then the real file will be checked too.

This should speed up do_package_qa slightly as libraries won't be
scanned repeatedly.

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

index d7f8f919c3a0f6d379f7f2a5853a3c564f56a2d7..c38720afdbf52c034660203aa3fab1de16e7f615 100644 (file)
@@ -709,12 +709,13 @@ def package_qa_walk(warnfuncs, errorfuncs, package, d):
     warnings = {}
     errors = {}
     for path in pkgfiles[package]:
-            elf = oe.qa.ELFFile(path)
-            try:
-                elf.open()
-            except (IOError, oe.qa.NotELFFileError):
-                # IOError can happen if the packaging control files disappear,
-                elf = None
+            elf = None
+            if os.path.isfile(path):
+                elf = oe.qa.ELFFile(path)
+                try:
+                    elf.open()
+                except oe.qa.NotELFFileError:
+                    elf = None
             for func in warnfuncs:
                 func(path, package, d, elf, warnings)
             for func in errorfuncs: