From 6dbf7e7152facae5c4bd342508eb260725603a9a Mon Sep 17 00:00:00 2001 From: Thomas Staudinger Date: Fri, 11 Oct 2024 17:49:58 +0200 Subject: [PATCH] yauto: Only scan "configure" files if they're text/plain Signed-off-by: Thomas Staudinger --- common/Scripts/yauto.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/common/Scripts/yauto.py b/common/Scripts/yauto.py index 7a84d1fe846..cc10d5183fe 100755 --- a/common/Scripts/yauto.py +++ b/common/Scripts/yauto.py @@ -14,6 +14,7 @@ import sys import os.path import dloader +import mimetypes import shutil # What we term as needed doc files @@ -143,12 +144,13 @@ def examine_source(self): if "configure" in file: # Check if we need to employ certain hacks needed in gnome packages f_path = os.path.join(root, file) - print("Checking %s for use of g-ir-scanner" % f_path) - - if self.check_is_gnomey(f_path): - known_types.append(GNOMEY) - else: - known_types.append(AUTOTOOLS) + # Check file type so we only scan text files + if mimetypes.guess_type(f_path)[0] == "text/plain": + print("Checking %s for use of g-ir-scanner" % f_path) + if self.check_is_gnomey(f_path): + known_types.append(GNOMEY) + else: + known_types.append(AUTOTOOLS) if ( "setup.py" in file or "pyproject.toml" in file