From 51d322dd4b0e896ddc31dd9769bda08906ee2d91 Mon Sep 17 00:00:00 2001 From: Aster Boese Date: Fri, 26 Jun 2026 20:02:11 +0200 Subject: [PATCH] ci: grep: disallow nonfree-firmware subpackages The original disallowing of these subpackages happened in 2024. It was expected that device packages would be voluntarily migrated by the maintainers to reflect this new rule. But, this never happened. Thus, enforcing this on all new and changed packages will force the fixing of these packages. This is not a treewide because so many packages still use the nonfree-firmware subpackage logic that an MR would be an absolute pain to handle and rebase. This is also a very easy fix to incorporate into unrelated changes. See https://postmarketos.org/edge/2024/02/15/default-nonfree-fw/ Part-of: --- .ci/grep.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.ci/grep.sh b/.ci/grep.sh index 0d5e37578..362dff8d7 100755 --- a/.ci/grep.sh +++ b/.ci/grep.sh @@ -180,6 +180,18 @@ if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then fi fi + # Disallow non-free firmware subpackages + CHANGED_APKBUILDS=$(git show --pretty="" --name-only --diff-filter=AMR "$CI_MERGE_REQUEST_DIFF_BASE_SHA"..HEAD | grep APKBUILD || true) + + if [ -n "$CHANGED_APKBUILDS" ]; then + if [ -n "$(grep -r 'pkgname-nonfree-firmware' $CHANGED_APKBUILDS || true)" ]; then + echo "ERROR: Please remove the nonfree-firmware subpackage(s) and move the firmware to depends in the following APKBUILDs." + echo "See https://docs.postmarketos.org/pmaports/main/packaging/firmware-packages.html" + grep --color=always -l 'pkgname-nonfree-firmware' $CHANGED_APKBUILDS + exit_code=1 + fi + fi + # Get latest commit message in MR case "$CI_COMMIT_DESCRIPTION" in *"[ci:skip-grep]"*)