Skip to content

Commit e7036a2

Browse files
committed
Update generate-stackbrew-library.sh to support BASHBREW_LIBRARY for easier cascading updates
See docker-library/official-images#17640 (comment)
1 parent b53c361 commit e7036a2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

generate-stackbrew-library.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,19 @@ dirCommit() {
4747

4848
getArches() {
4949
local repo="$1"; shift
50-
local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
50+
local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/"
5151

52-
eval "declare -g -A parentRepoToArches=( $(
53-
find -name 'Dockerfile' -exec awk '
52+
local parentRepoToArchesStr
53+
parentRepoToArchesStr="$(
54+
find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" '
5455
toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ {
55-
print "'"$officialImagesUrl"'" $2
56+
printf "%s%s\n", officialImagesBase, $2
5657
}
5758
' '{}' + \
5859
| sort -u \
59-
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
60-
) )"
60+
| xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"'
61+
)"
62+
eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )"
6163
}
6264
getArches 'pypy'
6365

0 commit comments

Comments
 (0)