diff options
author | Ross Burton <ross.burton@arm.com> | 2024-10-10 17:06:21 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-11 12:17:03 +0100 |
commit | c812b378e055e56e731713e72f2b5b9481b2dfb2 (patch) | |
tree | deba5bfe4e7de048aed6d2aea2a762812d72a9fa /meta/classes-global | |
parent | 68e5aa9b92c37c0eaa32f42a78df86940c33858c (diff) | |
download | poky-c812b378e055e56e731713e72f2b5b9481b2dfb2.tar.gz |
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.
(From OE-Core rev: 38454a2675f38c7db55efcb67bbb8b9fef7e0bf1)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r-- | meta/classes-global/insane.bbclass | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index 05b8538940..bec349e97c 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): | |||
82 | 82 | ||
83 | QAPATHTEST[shebang-size] = "package_qa_check_shebang_size" | 83 | QAPATHTEST[shebang-size] = "package_qa_check_shebang_size" |
84 | def package_qa_check_shebang_size(path, name, d, elf): | 84 | def package_qa_check_shebang_size(path, name, d, elf): |
85 | import stat | 85 | if elf or os.path.islink(path) or not os.path.isfile(path): |
86 | if os.path.islink(path) or stat.S_ISFIFO(os.stat(path).st_mode) or elf: | ||
87 | return | 86 | return |
88 | 87 | ||
89 | try: | 88 | try: |