packages
packages copied to clipboard
yauto: Only scan "configure" files if they're text/plain
Summary
This slightly changes the yauto logic so after it discovers a file with "configure" in the name, it will first check if it's a plain text file before further scanning it. This avoids issues with it trying to analyze e.g. image files.
Error example without this patch:
C-_4.13.1/resources/icons/png/configure.png for use of g-ir-scanner
Traceback (most recent call last):
File "/home/thomas/Projects/SolusPackaging/common/Scripts/yauto.py", line 410, in <module>
p.examine_source()
File "/home/thomas/Projects/SolusPackaging/common/Scripts/yauto.py", line 153, in examine_source
if self.check_is_gnomey(f_path):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/thomas/Projects/SolusPackaging/common/Scripts/yauto.py", line 394, in check_is_gnomey
lines = makefile.read()
^^^^^^^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
task: Failed to run task "new": exit status 1
Test Plan
Successfully created new package recipes for previously problematic tarballs:
go-task new -- calligra https://download.kde.org/stable/calligra/calligra-4.0.0.tar.xz
go-task new -- qlcplus https://github.com/mcallegari/qlcplus/archive/refs/tags/QLC+_4.13.1.tar.gz