Skip to content

Commit e903ede

Browse files
author
Damian Rouson
committed
Switch ftp downloads to curl on OS X.
1 parent 68025e3 commit e903ede

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

prerequisites/build-functions/download_if_necessary.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ download_if_necessary()
4444
elif [[ "${fetch}" == "git" ]]; then
4545
args="clone"
4646
elif [[ "${fetch}" == "curl" ]]; then
47-
args="-LO"
47+
first_three_characters=$(echo "${package_url}" | cut -c1-3)
48+
if [[ "${first_three_characters}" == "ftp" ]]; then
49+
args="-LO -u anonymous:"
50+
elif [[ "${first_three_characters}" == "htt" ]]; then
51+
args="-LO"
52+
else
53+
emergency "download_if_necessary.sh: Unrecognized URL."
54+
fi
4855
fi
4956

5057
if [[ "${fetch}" == "svn" || "${fetch}" == "git" ]]; then

prerequisites/build-functions/set_or_print_downloader.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,31 @@ set_or_print_downloader()
1313
${OPENCOARRAYS_SRC_DIR}/prerequisites/install-ofp.sh "${@}"
1414
exit 0
1515
fi
16-
if [[ "${package_name}" == "gcc" && "${version_to_build}" != "trunk" ]]; then
17-
gcc_fetch="ftp-url"
18-
else
19-
gcc_fetch="svn"
20-
fi
2116
if [[ $(uname) == "Darwin" ]]; then
2217
wget_or_curl=curl
18+
ftp_or_curl=curl
2319
else
2420
wget_or_curl=wget
21+
ftp_or_curl=ftp-url
22+
fi
23+
if [[ "${package_name}" == "gcc" && "${version_to_build}" != "trunk" ]]; then
24+
gcc_fetch="${ftp_or_curl}"
25+
else
26+
gcc_fetch="svn"
2527
fi
2628
# This is a bash 3 hack standing in for a bash 4 hash (bash 3 is the lowest common
2729
# denominator because, for licensing reasons, OS X only has bash 3 by default.)
2830
# See http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash
2931
package_fetch=(
30-
"gcc:$gcc_fetch"
31-
"wget:ftp-url"
32+
"gcc:${gcc_fetch}"
33+
"wget:${ftp_or_curl}"
3234
"cmake:${wget_or_curl}"
3335
"mpich:${wget_or_curl}"
3436
"flex:${wget_or_curl}"
35-
"bison:ftp-url"
37+
"bison:${ftp_or_curl}"
3638
"pkg-config:${wget_or_curl}"
37-
"make:ftp-url"
38-
"m4:ftp-url"
39+
"make:${ftp_or_curl}"
40+
"m4:${ftp_or_curl}"
3941
"subversion:${wget_or_curl}"
4042
)
4143
for package in "${package_fetch[@]}" ; do

0 commit comments

Comments
 (0)