@@ -53,7 +53,8 @@ _arches() {
53
53
_froms () {
54
54
bashbrew cat --format '
55
55
{{- range .TagEntries -}}
56
- {{- $.DockerFrom . -}}
56
+ {{- $meta := ($.DockerfileMetadata .) -}}
57
+ {{- $meta.Froms | join "\n" -}}
57
58
{{- "\n" -}}
58
59
{{- end -}}
59
60
' " $@ " | sort -u
@@ -63,10 +64,14 @@ declare -A naughtyFromsArches=(
63
64
# [img:tag=from:tag]='arch arch ...'
64
65
)
65
66
naughtyFroms=()
67
+ declare -A allNaughty=(
68
+ # [img:tag]=1
69
+ )
66
70
67
71
tags=" $( bashbrew list --uniq " $@ " | sort -u) "
68
72
for img in $tags ; do
69
73
arches=" $( _arches " $img " ) "
74
+ hasNice= # do we have _any_ arches that aren't naughty? (so we can make the message better if not)
70
75
for BASHBREW_ARCH in $arches ; do
71
76
export BASHBREW_ARCH
72
77
@@ -97,15 +102,25 @@ for img in $tags; do
97
102
naughtyFromsArches[" $img =$from " ]+=' , '
98
103
fi
99
104
naughtyFromsArches[" $img =$from " ]+=" $BASHBREW_ARCH "
105
+ else
106
+ hasNice=1
100
107
fi
101
108
done
102
109
done
110
+
111
+ if [ -z " $hasNice " ]; then
112
+ allNaughty[" $img " ]=1
113
+ fi
103
114
done
104
115
105
116
for naughtyFrom in " ${naughtyFroms[@]:- } " ; do
106
117
[ -n " $naughtyFrom " ] || continue # https://mywiki.wooledge.org/BashFAQ/112#BashFAQ.2F112.line-8 (empty array + "set -u" + bash 4.3 == sad day)
107
118
img=" ${naughtyFrom%% =* } "
108
119
from=" ${naughtyFrom# $img =} "
109
- arches=" ${naughtyFromsArches[$naughtyFrom]} "
110
- echo " - $img (FROM $from ) [$arches ]"
120
+ if [ -n " ${allNaughty["$img"]:- } " ]; then
121
+ echo " - $img (FROM $from ) -- completely unsupported base!"
122
+ else
123
+ arches=" ${naughtyFromsArches[$naughtyFrom]} "
124
+ echo " - $img (FROM $from ) [$arches ]"
125
+ fi
111
126
done
0 commit comments