forked from Mirror/pmbootstrap
pmb.lint: Don't try to lint apkbuild paths that are empty
This fixes an issue where pmb lint tries to lint an apkbuild using a repo path that the apkbuild doesn't exist in. For example, it fixes this: ``` [22:13:26] (native) linting postmarketos-ui-cosmic with apkbuild-lint [22:13:26] *** apkbuild-lint output *** Error: File APKBUILD does not exist [22:13:26] *** apkbuild-lint output *** [22:13:26] ERROR: Linter failed! Traceback (most recent call last): File "/builds/postmarketOS/pmaports/.ci/lib/apkbuild_linting.py", line 26, in <module> common.run_pmbootstrap(["-q", "lint"] + packages) File "/builds/postmarketOS/pmaports/.ci/lib/common.py", line 52, in run_pmbootstrap subprocess.run(cmd, universal_newlines=True, check=True) File "/usr/lib/python3.12/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['pmbootstrap', '--aports', '/builds/postmarketOS/pmaports', '-q', 'lint', 'postmarketos-ui-cosmic']' returned non-zero exit status 2. ``` Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2584
This commit is contained in:
parent
a80b27d0bd
commit
7ab40a4336
1 changed files with 3 additions and 0 deletions
|
@ -95,6 +95,9 @@ def check(pkgnames: Sequence[str]) -> None:
|
|||
# For each pkgrepo run the linter on the relevant packages
|
||||
has_failed = False
|
||||
for pkgrepo, apkbuild_paths in apkbuilds.items():
|
||||
# FIXME: somehow invalid paths get into this list
|
||||
if not apkbuild_paths:
|
||||
continue
|
||||
if pmb.chroot.user(
|
||||
["apkbuild-lint", *apkbuild_paths],
|
||||
check=False,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue