Skip to content

Remove Bash 4.0+ requirement to run prefetch.sh #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2018
Merged
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
9 changes: 5 additions & 4 deletions docker/build_scripts/prefetch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Prefetch tarballs so they don't need to be fetched in the container (which has
# very old tools). Requires Bash 4.0+, but this is not run inside the build context.
# very old tools).
#
# usage: prefetch.sh <output_dir> [name ...]
set -ex
Expand All @@ -15,9 +15,10 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}")
cd "$SOURCES"

for name in "$@"; do
root=${name^^}_ROOT
ext=${name^^}_EXTENSION
url=${name^^}_DOWNLOAD_URL
name_upper=$(echo "${name}" | tr [:lower:] [:upper:])
root=${name_upper}_ROOT
ext=${name_upper}_EXTENSION
url=${name_upper}_DOWNLOAD_URL
file=${!root}${!ext:-.tar.gz}
fetch_source $file ${!url}
done