From c136652f9c0b35aafa393e63567daf029ae03929 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 15 Feb 2016 17:48:25 +0000 Subject: lib/qa.py: raise ValueError if file isn't an ELF Instead of raising a generic Exception that can't be handled specifically, raise a ValueError. Also update the callers so any unexpected exceptions are not ignored. Also, rename isBigEngian() to isBigEndian(). Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/classes/insane.bbclass | 4 +++- meta/classes/uninative.bbclass | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'meta/classes') diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 530e711ec4..aef08fe28e 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass @@ -792,7 +792,9 @@ def package_qa_walk(warnfuncs, errorfuncs, skip, package, d): elf = oe.qa.ELFFile(path) try: elf.open() - except: + except (IOError, ValueError): + # IOError can happen if the packaging control files disappear, + # ValueError means the file isn't an ELF. elf = None for func in warnfuncs: func(path, package, d, elf, warnings) diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass index 0448cf6cdc..b14cec065e 100644 --- a/meta/classes/uninative.bbclass +++ b/meta/classes/uninative.bbclass @@ -80,7 +80,7 @@ python uninative_changeinterp () { elf = oe.qa.ELFFile(f) try: elf.open() - except: + except ValueError: continue #bb.warn("patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f)) -- cgit 1.2.3-korg