Skip to contentSkip to conversation

insane.bbclass: Count raw bytes in shebang-size

PATCH New Jan Garcia 1 participant 1 message Sep 20, 2023

lore
Share & tools
lore

Jan Garcia

author
#0 lore raw

PATCH 1/1 insane.bbclass: Count raw bytes in shebang-size

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.

---
 meta/classes-global/insane.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/classes-global/insane.bbclass +1 -2
index 2e53778934..5743d91240 100644
@@ -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
Signature · 1 line
2.41.0