build: trim blocklisted packages from top-level manifests too
Build containers / Compute changes (push) Successful in 3s
Build containers / fedora-cosmic (rawhide) (push) Failing after 59s
Build containers / fedora-remote (44) (push) Successful in 11m18s
Build containers / fedora-cosmic (44) (push) Successful in 13m39s
Build containers / Prune old releases and tags (push) Failing after 25s

kernel-modules-extra is declared in the upstream top-level common.yaml, not
under packages/, so the headless fedora-remote image still requested it while
also listing it in exclude-packages, which made compose fail with
'Packages not found: kernel-modules-extra'. Scan top-level manifests as well,
and drop keys whose block is left empty (comments/blanks do not count).
This commit is contained in:
2026-09-28 17:44:27 +02:00
parent 8e85980468
commit 40f7aef501
+11 -7
View File
@@ -89,14 +89,16 @@ gpgcheck=0
EOF EOF
} }
# Drop packages listed in a blocklist from the cloned upstream package # Drop packages listed in a blocklist from the cloned upstream manifests.
# manifests. rpm-ostree refuses (fatally) to exclude a package that an included # rpm-ostree refuses (fatally) to exclude a package that an included manifest
# manifest declares, so remove those lines at the source instead. # declares, so remove those lines at the source instead. Packages are declared
# both in packages/*.yaml and in the top-level variant manifests (e.g. the base
# kernel list lives in common.yaml), so scan both.
trim_upstream_packages() { trim_upstream_packages() {
local root="$1" local root="$1"
local blocklist="$2" local blocklist="$2"
local f local f
for f in "${root}"/packages/*.yaml; do for f in "${root}"/*.yaml "${root}"/packages/*.yaml; do
[[ -f "${f}" ]] || continue [[ -f "${f}" ]] || continue
awk ' awk '
NR == FNR { NR == FNR {
@@ -111,8 +113,9 @@ trim_upstream_packages() {
print print
} }
' "${blocklist}" "${f}" > "${f}.tmp" ' "${blocklist}" "${f}" > "${f}.tmp"
# Drop top-level keys that were left with no list items (e.g. if every # Drop top-level keys left with no list items or nested keys (e.g. if every
# entry under packages-x86_64: was removed). # entry under packages-x86_64: was removed). Comments and blank lines do not
# count as content, so a key followed only by comments is still dropped.
awk ' awk '
{ lines[NR] = $0 } { lines[NR] = $0 }
END { END {
@@ -120,8 +123,9 @@ trim_upstream_packages() {
if (lines[i] ~ /^[A-Za-z0-9_.-]+:$/) { if (lines[i] ~ /^[A-Za-z0-9_.-]+:$/) {
keep = 0 keep = 0
for (j = i + 1; j <= NR; j++) { for (j = i + 1; j <= NR; j++) {
if (lines[j] ~ /^[[:space:]]+-[[:space:]]/) { keep = 1; break }
if (lines[j] ~ /^[A-Za-z0-9_.-]+:/) break if (lines[j] ~ /^[A-Za-z0-9_.-]+:/) break
if (lines[j] ~ /^[[:space:]]+-[[:space:]]/) { keep = 1; break }
if (lines[j] ~ /^[[:space:]]+[A-Za-z0-9_.-]+:/) { keep = 1; break }
} }
if (!keep) continue if (!keep) continue
} }