Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yauto: Only scan "configure" files if they're text/plain #4030

Merged
merged 1 commit into from
Oct 20, 2024

Conversation

Staudey
Copy link
Member

@Staudey Staudey commented Oct 11, 2024

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

@EbonJaeger EbonJaeger added the hacktoberfest-accepted This PR is accepted for Hacktoberfest label Oct 15, 2024
@ermo ermo added the Topic: Tooling Tools and scripts label Oct 20, 2024
@ermo ermo added this to the Solus 4.7 milestone Oct 20, 2024
Copy link
Contributor

@ermo ermo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ermo ermo merged commit b9ac4ef into getsolus:main Oct 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted This PR is accepted for Hacktoberfest Topic: Tooling Tools and scripts
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants