CI: apkbuild-lint: fix checking only the 1st file

apkbuild-lint only checks the file from the first parameter:

$ apkbuild-lint main/postmarketos-ui-phosh/APKBUILD
IC[AL65]:main/postmarketos-ui-phosh/APKBUILD:66:2:non-local 'install' variable in function 'openrc'. Add install scripts to global install variable instead.
MC[AL49]:main/postmarketos-ui-phosh/APKBUILD:46:1:invalid option 'pmb:drm'
MC[AL49]:main/postmarketos-ui-phosh/APKBUILD:46:1:invalid option 'pmb:systemd'

$ apkbuild-lint main/hello-world/APKBUILD main/postmarketos-ui-phosh/APKBUILD
(empty output!)

Loop over the APKBUILDs we want to lint so all of them get checked.

Signed-off-by: Oliver Smith <ollieparanoid@postmarketos.org>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/8735>
This commit is contained in:
Oliver Smith 2026-06-05 16:15:07 +02:00 committed by The Friendly Meow (merge) Bot
parent 75b8400f82
commit ac3e4f8a70
No known key found for this signature in database

View file

@ -57,7 +57,11 @@ if __name__ == "__main__":
if len(apkbuilds_filtered) < 1:
print("No APKBUILDs to lint")
sys.exit(0)
try:
subprocess.run(["apkbuild-lint", *apkbuilds_filtered], text=True, check=True)
except subprocess.CalledProcessError as exception:
sys.exit(exception.returncode)
ret = 0
for apkbuild in apkbuilds_filtered:
try:
cmd = ["apkbuild-lint", apkbuild]
subprocess.run(cmd, text=True, check=True)
except subprocess.CalledProcessError as exception:
ret = exception.returncode
sys.exit(ret)