]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
insane.bbclass: Count raw bytes in shebang-size
authorJan Garcia <j@n-garcia.com>
Wed, 20 Sep 2023 19:51:56 +0000 (21:51 +0200)
committerSteve Sakoman <steve@sakoman.com>
Thu, 19 Oct 2023 14:34:38 +0000 (04:34 -1000)
Operating systems limit the shebang to a maximum number of bytes.
This patch makes the shebang-size check count raw bytes instead of UTF-8 characters.

Signed-off-by: Jan Garcia <j@n-garcia.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d4ac66c5cdaf971fb717cc5c5bf9aa51a787d412)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes-global/insane.bbclass

index ee34d5208d14ae118c6b46dbf11af1efcbeb7d21..e3a7d05ec38afd67917846083c13243adc33909d 100644 (file)
@@ -94,9 +94,8 @@ def package_qa_check_shebang_size(path, name, d, elf, messages):
         return
 
     if stanza.startswith(b'#!'):
-        #Shebang not found
         try:
-            stanza = stanza.decode("utf-8")
+            stanza.decode("utf-8")
         except UnicodeDecodeError:
             #If it is not a text file, it is not a script
             return