From d3e2224b02e573450cd23cdaf76de22359f7b391 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Sun, 28 Aug 2022 17:26:45 +0200 Subject: [PATCH] pkgbuild.discover_pkgbuilds(): warn and skip directories that don't contain a PKGBUILD --- packages/pkgbuild.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/pkgbuild.py b/packages/pkgbuild.py index b134b31..f0e7af5 100644 --- a/packages/pkgbuild.py +++ b/packages/pkgbuild.py @@ -300,7 +300,11 @@ def discover_pkgbuilds(parallel: bool = True, lazy: bool = True) -> dict[str, Pk init_pkgbuilds(interactive=False) for repo in REPOSITORIES: for dir in os.listdir(os.path.join(pkgbuilds_dir, repo)): - paths.append(os.path.join(repo, dir)) + p = os.path.join(repo, dir) + if not os.path.exists(os.path.join(pkgbuilds_dir, p, 'PKGBUILD')): + logging.warning(f"{p} doesn't include a PKGBUILD file; skipping") + continue + paths.append(p) logging.info("Parsing PKGBUILDs")