From: Ross Burton Date: Thu, 10 Oct 2024 16:06:21 +0000 (+0100) Subject: insane: optimise test in package_qa_check_shebang_size X-Git-Tag: yocto-5.2~1621 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38454a2675f38c7db55efcb67bbb8b9fef7e0bf1;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git insane: optimise test in package_qa_check_shebang_size Check whether the elf is not None first, before doing os.stat() calls on disk. Also don't check anything that isn't a file, not just FIFOs. Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 05b8538940d..bec349e97cc 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -82,8 +82,7 @@ def package_qa_clean_path(path, d, pkg=None): QAPATHTEST[shebang-size] = "package_qa_check_shebang_size" def package_qa_check_shebang_size(path, name, d, elf): - import stat - if os.path.islink(path) or stat.S_ISFIFO(os.stat(path).st_mode) or elf: + if elf or os.path.islink(path) or not os.path.isfile(path): return try: