]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
insane: optimise test in package_qa_check_shebang_size
authorRoss Burton <ross.burton@arm.com>
Thu, 10 Oct 2024 16:06:21 +0000 (17:06 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Oct 2024 11:16:59 +0000 (12:16 +0100)
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 <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/insane.bbclass

index 05b8538940d72aaf55414e342d4ded71fc88fcc6..bec349e97cc97ffe5ec8335b72a42df7d9d6b874 100644 (file)
@@ -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: