|
|
@@ -21,24 +21,39 @@ fi
|
|
|
|
|
|
imgs="$(bashbrew list --repos "$@" | sort -u)"
|
|
|
for img in $imgs; do
|
|
|
- IFS=$'\n'
|
|
|
- commits=( $(
|
|
|
+ commits="$(
|
|
|
bashbrew cat --format '
|
|
|
{{- range $e := .Entries -}}
|
|
|
{{- range $a := .Architectures -}}
|
|
|
{{- /* force `git fetch` */ -}}
|
|
|
{{- $froms := $.ArchDockerFroms $a $e -}}
|
|
|
-
|
|
|
- {{- $e.ArchGitCommit $a -}}
|
|
|
+ {
|
|
|
+ {{- json "GitRepo" }}:{{ json ($e.ArchGitRepo $a) -}},
|
|
|
+ {{- json "GitFetch" }}:{{ json ($e.ArchGitFetch $a) -}},
|
|
|
+ {{- json "GitCommit" }}:{{ json ($e.ArchGitCommit $a) -}}
|
|
|
+ }
|
|
|
{{- "\n" -}}
|
|
|
{{- end -}}
|
|
|
{{- end -}}
|
|
|
- ' "$img" | sort -u
|
|
|
- ) )
|
|
|
- unset IFS
|
|
|
+ ' "$img" | jq -s 'unique'
|
|
|
+ )"
|
|
|
|
|
|
declare -A naughtyCommits=() naughtyTopCommits=() seenCommits=()
|
|
|
- for topCommit in "${commits[@]}"; do
|
|
|
+ length="$(jq -r 'length' <<<"$commits")"
|
|
|
+ for (( i = 0; i < length; i++ )); do
|
|
|
+ topCommit="$(jq -r ".[$i].GitCommit" <<<"$commits")"
|
|
|
+ gitRepo="$(jq -r ".[$i].GitRepo" <<<"$commits")"
|
|
|
+ gitFetch="$(jq -r ".[$i].GitFetch" <<<"$commits")"
|
|
|
+
|
|
|
+ if ! _git fetch --quiet "$gitRepo" "$gitFetch:" ; then
|
|
|
+ naughtyCommits[$topCommit]="unable to to fetch specified GitFetch: $gitFetch"
|
|
|
+ naughtyTopCommits[$topCommit]="$topCommit"
|
|
|
+ elif ! _git merge-base --is-ancestor "$topCommit" 'FETCH_HEAD'; then
|
|
|
+ # check that the commit is in the GitFetch branch specified
|
|
|
+ naughtyCommits[$topCommit]="is not in the specified ref GitFetch: $gitFetch"
|
|
|
+ naughtyTopCommits[$topCommit]="$topCommit"
|
|
|
+ fi
|
|
|
+
|
|
|
IFS=$'\n'
|
|
|
potentiallyNaughtyGlobs=( '**.tar**' )
|
|
|
potentiallyNaughtyCommits=( $(_git log --diff-filter=DMT --format='format:%H' "$topCommit" -- "${potentiallyNaughtyGlobs[@]}") )
|
|
|
@@ -73,8 +88,12 @@ for img in $imgs; do
|
|
|
done
|
|
|
|
|
|
if [ "${#naughtyReasons[@]}" -gt 0 ]; then
|
|
|
+ : "${naughtyCommits[$commit]:=}"
|
|
|
+ if [ -n "${naughtyCommits[$commit]}" ]; then
|
|
|
+ naughtyCommits[$commit]+=$'\n'
|
|
|
+ fi
|
|
|
IFS=$'\n'
|
|
|
- naughtyCommits[$commit]="${naughtyReasons[*]}"
|
|
|
+ naughtyCommits[$commit]+="${naughtyReasons[*]}"
|
|
|
unset IFS
|
|
|
naughtyTopCommits[$commit]="$topCommit"
|
|
|
fi
|