Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 30 additions & 18 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare -A aliases=(
self="$(basename "$BASH_SOURCE")"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

versions=( */ )
versions=( */*/ )
versions=( "${versions[@]%/}" )

# get the most recent commit which modified any of "$@"
Expand Down Expand Up @@ -66,23 +66,35 @@ join() {
}

for version in "${versions[@]}"; do
versionAliases=( $version ${aliases[$version]:-} )

if debianSuite="$(
wget -qO- -o /dev/null "https://deb.debian.org/debian/dists/$version/Release" \
| gawk -F ':[[:space:]]+' '$1 == "Suite" { print $2 }'
)" && [ -n "$debianSuite" ]; then
# "stable", "oldstable", etc.
versionAliases+=( "$debianSuite" )
if [ "$debianSuite" = 'stable' ]; then
versionAliases+=( latest )
fi
elif ubuntuVersion="$(
wget -qO- -o /dev/null "http://archive.ubuntu.com/ubuntu/dists/$version/Release" \
| gawk -F ':[[:space:]]+' '$1 == "Version" { print $2 }'
)" && [ -n "$ubuntuVersion" ]; then
versionAliases+=( "$ubuntuVersion" )
fi
suite="$(basename "$version")"
dist="$(dirname "$version")"
dist="$(basename "$dist")"

versionAliases=( $suite ${aliases[$suite]:-} )

case "$dist" in
debian)
if debianSuite="$(
wget -qO- -o /dev/null "https://deb.debian.org/debian/dists/$suite/Release" \
| gawk -F ':[[:space:]]+' '$1 == "Suite" { print $2 }'
)" && [ -n "$debianSuite" ]; then
# "stable", "oldstable", etc.
versionAliases+=( "$debianSuite" )
if [ "$debianSuite" = 'stable' ]; then
versionAliases+=( latest )
fi
fi
;;

ubuntu)
if ubuntuVersion="$(
wget -qO- -o /dev/null "http://archive.ubuntu.com/ubuntu/dists/$suite/Release" \
| gawk -F ':[[:space:]]+' '$1 == "Version" { print $2 }'
)" && [ -n "$ubuntuVersion" ]; then
versionAliases+=( "$ubuntuVersion" )
fi
;;
esac

parent="$(awk 'toupper($1) == "FROM" { print $2 }' "$version/curl/Dockerfile")"
arches="${parentRepoToArches[$parent]}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 11 additions & 14 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,34 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"

versions=( "$@" )
if [ ${#versions[@]} -eq 0 ]; then
versions=( */ )
versions=( */*/ )
fi
versions=( "${versions[@]%/}" )

for version in "${versions[@]}"; do
if bashbrew list "https://github.com/docker-library/official-images/raw/master/library/debian:$version" &> /dev/null; then
dist='debian'
elif bashbrew list "https://github.com/docker-library/official-images/raw/master/library/ubuntu:$version" &> /dev/null; then
dist='ubuntu'
else
echo >&2 "error: cannot determine repo for '$version'"
exit 1
fi
echo "$version: $dist"
suite="$(basename "$version")"
dist="$(dirname "$version")"
dist="$(basename "$dist")"
echo "$version"
for variant in curl scm ''; do
src="Dockerfile${variant:+-$variant}.template"
trg="$version${variant:+/$variant}/Dockerfile"
mkdir -p "$(dirname "$trg")"
sed \
-e 's!DIST!'"$dist"'!g' \
-e 's!SUITE!'"$version"'!g' \
-e 's!SUITE!'"$suite"'!g' \
"$src" > "$trg"
if [ "$dist" = 'debian' ]; then
# remove "bzr" from buster and later
case "$version" in
jessie|stretch) echo ' - how bizarre (still includes "bzr")' ;;
case "$suite" in
jessie | stretch)
echo ' - how bizarre (still includes "bzr")'
;;
*)
sed -i '/bzr/d' "$version/scm/Dockerfile"
;;
esac
if [ "$version" = 'jessie' ]; then
if [ "$suite" = 'jessie' ]; then
sed -i '/libmaxminddb-dev/d' "$version/Dockerfile"
fi
fi
Expand Down