]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Sep 2023 06:43:51 +0000 (07:43 +0100)
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>
meta/classes-global/insane.bbclass

index 2e537789347642317c7f1997ddd0ddc9a7f451b0..5743d91240b25eb1db750c80349c61ac91f8384b 100644 (file)
@@ -97,9 +97,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