Skip to content
This repository has been archived by the owner on Nov 30, 2019. It is now read-only.

Commit

Permalink
Modified make-distribution.sh so that we use curl, not only wget to g…
Browse files Browse the repository at this point in the history
…et tachyon
  • Loading branch information
sarutak committed Jan 10, 2015
1 parent 4e1f12d commit 83b49b5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
4 changes: 2 additions & 2 deletions build/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ install_app() {
# check if we already have the tarball
# check if we have curl installed
# download application
[ ! -f "${local_tarball}" ] && [ -n "`which curl 2>/dev/null`" ] && \
[ ! -f "${local_tarball}" ] && [ -n "`type curl 2>/dev/null`" ] && \
echo "exec: curl ${curl_opts} ${remote_tarball}" && \
curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
# if the file still doesn't exist, lets try `wget` and cross our fingers
[ ! -f "${local_tarball}" ] && [ -n "`which wget 2>/dev/null`" ] && \
[ ! -f "${local_tarball}" ] && [ -n "`type wget 2>/dev/null`" ] && \
echo "exec: wget ${wget_opts} ${remote_tarball}" && \
wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
# if both were unsuccessful, exit
Expand Down
4 changes: 2 additions & 2 deletions build/sbt-launch-lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ acquire_sbt_jar () {
# Download
printf "Attempting to fetch sbt\n"
JAR_DL="${JAR}.part"
if hash curl 2>/dev/null; then
if type curl &>/dev/null; then
(curl --silent ${URL1} > "${JAR_DL}" || curl --silent ${URL2} > "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
elif hash wget 2>/dev/null; then
elif type wget &>/dev/null; then
(wget --quiet ${URL1} -O "${JAR_DL}" || wget --quiet ${URL2} -O "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
else
printf "You do not have curl or wget installed, please install sbt manually from http://www.scala-sbt.org/\n"
Expand Down
22 changes: 11 additions & 11 deletions dev/check-license
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ acquire_rat_jar () {
if [[ ! -f "$rat_jar" ]]; then
# Download rat launch jar if it hasn't been downloaded yet
if [ ! -f "$JAR" ]; then
# Download
printf "Attempting to fetch rat\n"
JAR_DL="${JAR}.part"
if hash curl 2>/dev/null; then
curl --silent "${URL}" > "$JAR_DL" && mv "$JAR_DL" "$JAR"
elif hash wget 2>/dev/null; then
wget --quiet ${URL} -O "$JAR_DL" && mv "$JAR_DL" "$JAR"
else
printf "You do not have curl or wget installed, please install rat manually.\n"
exit -1
fi
# Download
printf "Attempting to fetch rat\n"
JAR_DL="${JAR}.part"
if type curl &>/dev/null; then
curl --silent "${URL}" > "$JAR_DL" && mv "$JAR_DL" "$JAR"
elif type wget &>/dev/null; then
wget --quiet ${URL} -O "$JAR_DL" && mv "$JAR_DL" "$JAR"
else
printf "You do not have curl or wget installed, please install rat manually.\n"
exit -1
fi
fi

unzip -tq $JAR &> /dev/null
Expand Down
14 changes: 12 additions & 2 deletions make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,24 @@ cp -r "$SPARK_HOME/ec2" "$DISTDIR"
if [ "$SPARK_TACHYON" == "true" ]; then
TACHYON_VERSION="0.5.0"
TACHYON_URL="https://github.com/amplab/tachyon/releases/download/v${TACHYON_VERSION}/tachyon-${TACHYON_VERSION}-bin.tar.gz"
TACHYON_TGZ="tachyon-${TACHYON_VERSION}-bin.tar.gz"

TMPD=`mktemp -d 2>/dev/null || mktemp -d -t 'disttmp'`

pushd $TMPD > /dev/null
echo "Fetching tachyon tgz"
wget "$TACHYON_URL"

tar xf "tachyon-${TACHYON_VERSION}-bin.tar.gz"
TACHYON_DL="${TACHYON_TGZ}.part"
if type curl &>/dev/null; then
curl --silent -k -L "${TACHYON_URL}" > "${TACHYON_DL}" && mv "${TACHYON_DL}" "${TACHYON_TGZ}"
elif type wget &>/dev/null; then
wget --quiet "${TACHYON_URL}" -O "${TACHYON_DL}" && mv "${TACHYON_DL}" "${TACHYON_TGZ}"
else
printf "You do not have curl or wget installed. please install Tachyon manually.\n"
exit -1
fi

tar xzf "${TACHYON_TGZ}"
cp "tachyon-${TACHYON_VERSION}/core/target/tachyon-${TACHYON_VERSION}-jar-with-dependencies.jar" "$DISTDIR/lib"
mkdir -p "$DISTDIR/tachyon/src/main/java/tachyon/web"
cp -r "tachyon-${TACHYON_VERSION}"/{bin,conf,libexec} "$DISTDIR/tachyon"
Expand Down

0 comments on commit 83b49b5

Please sign in to comment.