Skip to content

Commit 3625dc6

Browse files
mayeutogrisel
authored andcommitted
Remove Bash 4.0+ requirement to run prefetch.sh (pypa#205)
This allows to run the build script from a host that provides bash 3.x (e.g. macOS)
1 parent 1971a37 commit 3625dc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docker/build_scripts/prefetch.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# Prefetch tarballs so they don't need to be fetched in the container (which has
3-
# very old tools). Requires Bash 4.0+, but this is not run inside the build context.
3+
# very old tools).
44
#
55
# usage: prefetch.sh <output_dir> [name ...]
66
set -ex
@@ -15,9 +15,10 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}")
1515
cd "$SOURCES"
1616

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

0 commit comments

Comments
 (0)