diff --git a/utils.py b/utils.py index 1fe5d09..3bb53ce 100644 --- a/utils.py +++ b/utils.py @@ -28,13 +28,17 @@ def import_keys(pkgbuild: str) -> bool: def parse_pkgbuild(pkgbuild_file: str) -> dict: pkgbuild_path = pathlib.Path(pkgbuild_file) os.chdir(pkgbuild_path.parent) - res = subprocess.run(["makepkg", "--printsrcinfo"], check=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + res = subprocess.run(["makepkg", "--printsrcinfo"], check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) os.chdir(sys.path[0]) + if res.returncode: + logging.warning("[PKGBUILD] makekg failed: %s", res.stdout.decode(errors="ignore")) + return {} + (parsed, errors) = parse_srcinfo(res.stdout.decode(errors="ignore")) if errors: - logging.warning("[PKGBUILD] Failed to parse: %s", pkgbuild_path.name) + logging.warning("[PKGBUILD] Failed to parse %s: %s", pkgbuild_path.name, errors) return {} return parsed