8989ARCHES=" $( awk -F= ' NF { print $1 }' <<< " $pairs" | LC_ALL=C sort) "
9090n_arch=" $( awk ' NF' <<< " $ARCHES" | wc -l | tr -d ' [:space:]' ) "
9191
92+ disabled_arches () {
93+ awk '
94+ /^[[:space:]]*#[[:space:]]*-[[:space:]]+docker_arch:/ {
95+ s = $0
96+ sub(/^[^:]*:[[:space:]]*/, "", s)
97+ sub(/[[:space:]]*$/, "", s)
98+ print s
99+ }
100+ ' " $1 "
101+ }
102+
103+ KNOWN=" $( printf ' %s\n%s\n' " $ARCHES " " $( disabled_arches " $WF " | tr -d ' \r' ) " | awk ' NF' | LC_ALL=C sort -u) "
104+ n_known=" $( awk ' NF' <<< " $KNOWN" | wc -l | tr -d ' [:space:]' ) "
105+
92106dupes=" $( printf ' %s\n' " $ARCHES " | uniq -d | tr ' \n' ' ' ) "
93107no_platform=" $( awk -F= ' $2 == "-" { print $1 }' <<< " $pairs" | tr ' \n' ' ' ) "
94108
@@ -137,7 +151,7 @@ while IFS= read -r arch; do
137151 else
138152 tagnames_broken=" $tagnames_broken $arch "
139153 fi
140- done <<< " $ARCHES "
154+ done <<< " $KNOWN "
141155
142156# The OCI spelling, which is the platform with linux/ taken off. armv7 is the
143157# only one where that leaves a slash behind.
@@ -149,7 +163,7 @@ while IFS='=' read -r a p; do
149163done <<< " $pairs"
150164
151165n_tokens=" $( awk ' NF' <<< " $TOKENS" | LC_ALL=C sort -u | wc -l | tr -d ' [:space:]' ) "
152- diag " $n_tokens spellings map onto $n_arch architectures"
166+ diag " $n_tokens spellings map onto $n_known known architectures"
153167
154168# ---------------------------------------------------------------------------#
155169# 3. every architecture loop names the whole set
@@ -204,7 +218,7 @@ loops() {
204218 ' " $1 "
205219}
206220
207- want=" $( printf ' %s\n' " $ARCHES " | awk ' NF' | LC_ALL=C sort -u) "
221+ want=" $( printf ' %s\n' " $KNOWN " | awk ' NF' | LC_ALL=C sort -u) "
208222n_loops=0
209223
210224while IFS= read -r file; do
@@ -219,12 +233,12 @@ while IFS= read -r file; do
219233 words_nl=" $( printf ' %s' " $words " | tr ' [:space:]' ' \n' | awk ' NF' ) "
220234 got=" "
221235 unknown=" "
222- n_known =0
236+ n_spelled =0
223237 while IFS= read -r w; do
224238 [ -n " $w " ] || continue
225239 a=" $( token_arch " $w " ) "
226240 if [ -n " $a " ]; then
227- n_known =$(( n_known + 1 ))
241+ n_spelled =$(( n_spelled + 1 ))
228242 got=" $got$a
229243"
230244 else
@@ -234,7 +248,7 @@ while IFS= read -r file; do
234248
235249 # Not an architecture loop at all. Every other for loop in the tree is none
236250 # of this file's business.
237- [ " $n_known " -gt 0 ] || continue
251+ [ " $n_spelled " -gt 0 ] || continue
238252 n_loops=$(( n_loops + 1 ))
239253
240254 got_set=" $( printf ' %s\n' " $got " | awk ' NF' | LC_ALL=C sort -u) "
@@ -261,15 +275,17 @@ while IFS= read -r file; do
261275 else
262276 ok " $rel :$lineno names the whole architecture set"
263277 fi
278+ elif [ " $got_set " = " $ARCHES " ]; then
279+ ok " $rel :$lineno names the built architecture set"
264280 elif [ " $mark " = " subset" ]; then
265281 ok " $rel :$lineno is a marked subset: $( printf ' %s' " $got_set " | tr ' \n' ' ' ) "
266282 else
267283 missing=" $( LC_ALL=C comm -23 <( printf ' %s\n' " $want " ) <( printf ' %s\n' " $got_set " ) | tr ' \n' ' ' ) "
268284 extra=" $( LC_ALL=C comm -13 <( printf ' %s\n' " $want " ) <( printf ' %s\n' " $got_set " ) | tr ' \n' ' ' ) "
269285 fail " $rel :$lineno names the whole architecture set" \
270286 " missing: ${missing:- none} " \
271- " not in the build matrix : ${extra:- none} " \
272- " the matrix names: $( printf ' %s' " $want " | tr ' \n' ' ' ) " \
287+ " not in the set : ${extra:- none} " \
288+ " the set names: $( printf ' %s' " $want " | tr ' \n' ' ' ) " \
273289 " if it is meant to cover fewer, write the reason in a comment above it and mark that comment" \
274290 " reproduce: sed -n '${lineno} p' $rel "
275291 fi
@@ -317,11 +333,11 @@ else
317333 " no case label found inside aliases_for" \
318334 " reproduce: sed -n '/aliases_for()/,/^}/p' scripts/tag-names"
319335 elif [ " $labels " = " $want " ]; then
320- ok " scripts/tag-names has an alias set for exactly the $n_arch matrix architectures"
336+ ok " scripts/tag-names has an alias set for exactly the $n_known known architectures"
321337 else
322338 only_matrix=" $( LC_ALL=C comm -23 <( printf ' %s\n' " $want " ) <( printf ' %s\n' " $labels " ) | tr ' \n' ' ' ) "
323339 only_table=" $( LC_ALL=C comm -13 <( printf ' %s\n' " $want " ) <( printf ' %s\n' " $labels " ) | tr ' \n' ' ' ) "
324- fail " scripts/tag-names has an alias set for exactly the $n_arch matrix architectures" \
340+ fail " scripts/tag-names has an alias set for exactly the $n_known known architectures" \
325341 " built and has no alias set: ${only_matrix:- none} " \
326342 " has an alias set and is not built: ${only_table:- none} " \
327343 " reproduce: sed -n '/aliases_for()/,/^}/p' scripts/tag-names"
@@ -352,11 +368,11 @@ else
352368 else
353369 named=" $( printf ' %s' " $usage " | tr ' |' ' \n' | awk ' NF && $0 != "all"' | LC_ALL=C sort -u) "
354370 if [ " $named " = " $want " ]; then
355- ok " the gen-mirrorlist usage string names exactly the $n_arch matrix architectures"
371+ ok " the gen-mirrorlist usage string names exactly the $n_known known architectures"
356372 else
357- fail " the gen-mirrorlist usage string names exactly the $n_arch matrix architectures" \
373+ fail " the gen-mirrorlist usage string names exactly the $n_known known architectures" \
358374 " it says: <$usage >" \
359- " the matrix names: $( printf ' %s' " $want " | tr ' \n' ' ' ) " \
375+ " the set names: $( printf ' %s' " $want " | tr ' \n' ' ' ) " \
360376 " reproduce: grep -n 'usage: scripts/gen-mirrorlist' scripts/gen-mirrorlist"
361377 fi
362378 fi
@@ -392,12 +408,12 @@ while IFS= read -r arch; do
392408 else
393409 fail " $arch has all $n_paths of its per architecture files" \
394410 " not in the tree:$absent " \
395- " the build matrix names $arch , so the build will go looking for these " \
411+ " the set names $arch , so its files are expected " \
396412 " reproduce: ls$absent "
397413 fi
398- done <<< " $ARCHES "
414+ done <<< " $KNOWN "
399415
400- # The other direction. A directory for an architecture the matrix does not name
416+ # The other direction. A directory for an architecture the set does not name
401417# is either one that was removed and left files behind, or one somebody started
402418# adding and did not finish.
403419#
@@ -417,17 +433,17 @@ for d in rootfs bootstrap; do
417433 if grep -qxF " $name " <<< " $SHARED" ; then
418434 continue
419435 fi
420- if grep -qxF " $name " <<< " $ARCHES " ; then
436+ if grep -qxF " $name " <<< " $KNOWN " ; then
421437 continue
422438 fi
423439 orphans=" $orphans $d /$name "
424440 done <<< " $(find " $REPO_ROOT /$d " -mindepth 1 -maxdepth 1 -type d | LC_ALL=C sort)"
425441done
426442
427443if [ -z " $( printf ' %s' " $orphans " | tr -d ' [:space:]' ) " ]; then
428- ok " no rootfs or bootstrap directory belongs to an architecture the matrix does not build "
444+ ok " no rootfs or bootstrap directory belongs to an architecture the set does not name "
429445else
430- fail " no rootfs or bootstrap directory belongs to an architecture the matrix does not build " \
446+ fail " no rootfs or bootstrap directory belongs to an architecture the set does not name " \
431447 " not in the matrix:$orphans " \
432448 " either the matrix lost an architecture or these files outlived one" \
433449 " reproduce: ls -d$orphans "
@@ -451,11 +467,11 @@ else
451467 " no expect_alias_count call found" \
452468 " reproduce: grep -n expect_alias_count tests/static/60-tag-families.sh"
453469 elif [ " $covered " = " $want " ]; then
454- ok " 60-tag-families.sh checks an alias count for all $n_arch architectures"
470+ ok " 60-tag-families.sh checks an alias count for all $n_known known architectures"
455471 else
456472 uncovered=" $( LC_ALL=C comm -23 <( printf ' %s\n' " $want " ) <( printf ' %s\n' " $covered " ) | tr ' \n' ' ' ) "
457473 stale=" $( LC_ALL=C comm -13 <( printf ' %s\n' " $want " ) <( printf ' %s\n' " $covered " ) | tr ' \n' ' ' ) "
458- fail " 60-tag-families.sh checks an alias count for all $n_arch architectures" \
474+ fail " 60-tag-families.sh checks an alias count for all $n_known known architectures" \
459475 " built and unchecked there: ${uncovered:- none} " \
460476 " checked there and not built: ${stale:- none} " \
461477 " reproduce: grep -n expect_alias_count tests/static/60-tag-families.sh"
0 commit comments