diff mbox series

insane.bbclass: Count raw bytes in shebang-size

Message ID 20230920195156.9805-1-j@n-garcia.com
State Accepted, archived
Commit d4ac66c5cdaf971fb717cc5c5bf9aa51a787d412
Headers show
Series insane.bbclass: Count raw bytes in shebang-size | expand

Commit Message

Jan Garcia Sept. 20, 2023, 7:51 p.m. UTC
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>
---
 meta/classes-global/insane.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index 2e53778934..5743d91240 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -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