Skip to contentSkip to conversation

insane: only load real files as ELF

PATCH New Ross Burton 1 participant 1 message Sep 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 insane: only load real files as ELF

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.

---
 meta/classes/insane.bbclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
meta/classes/insane.bbclass +7 -6
index d7f8f919c3..c38720afdb 100644
@@ -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:
Signature · 1 line
2.28.0