Skip to content

Commit cc30612

Browse files
ddseapyjahhulbert-ccri
authored andcommitted
Replace mirror with apache archive to support old versions (#65)
* Fix missing kafka tgz from mirror by pointing to archive.apache.org * Use apache archive server instead of mirror to support old version
1 parent 08f9901 commit cc30612

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

bin/cloud-local.sh

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,40 +79,29 @@ function download_packages {
7979
|| { rm -f "${file}"; echo "Error downloading: ${file}"; errorList="${errorList} scala-${pkg_scala_ver}.tgz ${NL}"; };
8080
fi
8181

82-
local mirror
83-
if [[ -z ${pkg_src_mirror+x} ]]; then
84-
# If we are using a proxy we should try to always use the same mirror
85-
if [[ ! -z ${http_proxy+x} ]]; then
86-
local mirror=$(curl -s 'https://www.apache.org/dyn/closer.cgi' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g'|grep -v ftp: |grep .edu/ |sort |head -1)
87-
else
88-
local mirror=$(curl -s 'https://www.apache.org/dyn/closer.cgi' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g' | head -1)
89-
fi
90-
else
91-
local mirror=${pkg_src_mirror}
92-
fi
93-
echo "Using mirror ${mirror}"
82+
local apache_archive_url="http://archive.apache.org/dist"
9483

9584
local maven=${pkg_src_maven}
9685

97-
declare -a urls=("${mirror}/hadoop/common/hadoop-${pkg_hadoop_ver}/hadoop-${pkg_hadoop_ver}.tar.gz"
98-
"${mirror}/zookeeper/zookeeper-${pkg_zookeeper_ver}/zookeeper-${pkg_zookeeper_ver}.tar.gz"
99-
"${mirror}/spark/spark-${pkg_spark_ver}/spark-${pkg_spark_ver}-bin-${pkg_spark_hadoop_ver}.tgz")
86+
declare -a urls=("${apache_archive_url}/hadoop/common/hadoop-${pkg_hadoop_ver}/hadoop-${pkg_hadoop_ver}.tar.gz"
87+
"${apache_archive_url}/zookeeper/zookeeper-${pkg_zookeeper_ver}/zookeeper-${pkg_zookeeper_ver}.tar.gz"
88+
"${apache_archive_url}/spark/spark-${pkg_spark_ver}/spark-${pkg_spark_ver}-bin-${pkg_spark_hadoop_ver}.tgz")
10089

10190

10291
if [[ "$kafka_enabled" -eq 1 ]]; then
103-
urls=("${urls[@]}" "${mirror}/kafka/${pkg_kafka_ver}/kafka_${pkg_kafka_scala_ver}-${pkg_kafka_ver}.tgz")
92+
urls=("${urls[@]}" "${apache_archive_url}/kafka/${pkg_kafka_ver}/kafka_${pkg_kafka_scala_ver}-${pkg_kafka_ver}.tgz")
10493
fi
10594

10695
if [[ "$acc_enabled" -eq 1 ]]; then
10796
urls=("${urls[@]}" "${maven}/org/apache/accumulo/accumulo/${pkg_accumulo_ver}/accumulo-${pkg_accumulo_ver}-bin.tar.gz")
10897
fi
10998

11099
if [[ "$hbase_enabled" -eq 1 ]]; then
111-
urls=("${urls[@]}" "${mirror}/hbase/${pkg_hbase_ver}/hbase-${pkg_hbase_ver}-bin.tar.gz")
100+
urls=("${urls[@]}" "${apache_archive_url}/hbase/${pkg_hbase_ver}/hbase-${pkg_hbase_ver}-bin.tar.gz")
112101
fi
113102

114103
if [[ "$zeppelin_enabled" -eq 1 ]]; then
115-
urls=("${urls[@]}" "${mirror}zeppelin/zeppelin-${pkg_zeppelin_ver}/zeppelin-${pkg_zeppelin_ver}-bin-all.tgz")
104+
urls=("${urls[@]}" "${apache_archive_url}zeppelin/zeppelin-${pkg_zeppelin_ver}/zeppelin-${pkg_zeppelin_ver}-bin-all.tgz")
116105
fi
117106

118107
for x in "${urls[@]}"; do

0 commit comments

Comments
 (0)