Skip to content

Commit

Permalink
Add explicit "alias" files with the raw XX.YY version in them (since …
Browse files Browse the repository at this point in the history
…xenial doesn't seem to contain /etc/os-release in the base tarball)
  • Loading branch information
tianon committed Dec 18, 2015
1 parent 964bdc2 commit 53ea280
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 3 deletions.
11 changes: 8 additions & 3 deletions generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,25 @@ fi
arch="$(dpkg --print-architecture)"
for version in "${versions[@]}"; do
commit="$(git log -1 --format='format:%H' -- "$version")"
serial="$(awk -F '=' '$1 == "SERIAL" { print $2; exit }' "$version/build-info.txt")"
serial="$(awk -F '=' '$1 == "SERIAL" { print $2; exit }' "$version/build-info.txt" 2>&1 || true)"
[ "$serial" ] || continue

versionAliases=()

[ -s "$version/alias" ] && versionAliases+=( $(< "$version/alias") )

if [ -z "${noVersion[$version]}" ]; then
tarball="$version/ubuntu-$version-core-cloudimg-$arch-root.tar.gz"
fullVersion="$(tar -xvf "$tarball" etc/debian_version --to-stdout 2>/dev/null)"
if [ -z "$fullVersion" ] || [[ "$fullVersion" == */sid ]]; then
fullVersion="$(eval "$(tar -xvf "$tarball" etc/os-release --to-stdout 2>/dev/null)" && echo "$VERSION" | cut -d' ' -f1)"
fi
if [ "$fullVersion" ]; then
versionAliases+=( $fullVersion )
#versionAliases+=( $fullVersion )
if [ "${fullVersion%.*.*}" != "$fullVersion" ]; then
# three part version like "12.04.4"
versionAliases+=( ${fullVersion%.*} )
#versionAliases+=( ${fullVersion%.*} )
versionAliases=( $fullVersion "${versionAliases[@]}" )
fi
fi
fi
Expand Down
Empty file removed precise/.keep
Empty file.
1 change: 1 addition & 0 deletions precise/alias
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.04
Empty file removed trusty/.keep
Empty file.
1 change: 1 addition & 0 deletions trusty/alias
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14.04
Empty file removed vivid/.keep
Empty file.
1 change: 1 addition & 0 deletions vivid/alias
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15.04
Empty file removed wily/.keep
Empty file.
1 change: 1 addition & 0 deletions wily/alias
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15.10
Empty file removed xenial/.keep
Empty file.
1 change: 1 addition & 0 deletions xenial/alias
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.04

0 comments on commit 53ea280

Please sign in to comment.