Repository: spark
Updated Branches:
  refs/heads/branch-1.3 047a61365 -> cc5f711c0


[SPARK-9254] [BUILD] [HOTFIX] sbt-launch-lib.bash should support HTTP/HTTPS 
redirection

Target file(s) can be hosted on CDN nodes. HTTP/HTTPS redirection must be 
supported to download these files.

Author: Cheng Lian <[email protected]>

Closes #7597 from liancheng/spark-9254 and squashes the following commits:

fd266ca [Cheng Lian] Uses `--fail' to make curl return non-zero value and 
remove garbage output when the download fails
a7cbfb3 [Cheng Lian] Supports HTTP/HTTPS redirection

(cherry picked from commit b55a36bc30a628d76baa721d38789fc219eccc27)
Signed-off-by: Sean Owen <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/cc5f711c
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/cc5f711c
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/cc5f711c

Branch: refs/heads/branch-1.3
Commit: cc5f711c01c3ae3d9e07ec7f337559c83bdef06a
Parents: 047a613
Author: Cheng Lian <[email protected]>
Authored: Wed Jul 22 09:32:42 2015 -0700
Committer: Sean Owen <[email protected]>
Committed: Sun Aug 2 13:56:48 2015 +0100

----------------------------------------------------------------------
 build/sbt-launch-lib.bash | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/cc5f711c/build/sbt-launch-lib.bash
----------------------------------------------------------------------
diff --git a/build/sbt-launch-lib.bash b/build/sbt-launch-lib.bash
index 504be48..7930a38 100755
--- a/build/sbt-launch-lib.bash
+++ b/build/sbt-launch-lib.bash
@@ -51,9 +51,13 @@ acquire_sbt_jar () {
     printf "Attempting to fetch sbt\n"
     JAR_DL="${JAR}.part"
     if [ $(command -v curl) ]; then
-      (curl --silent ${URL1} > "${JAR_DL}" || curl --silent ${URL2} > 
"${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
+      (curl --fail --location --silent ${URL1} > "${JAR_DL}" ||\
+        (rm -f "${JAR_DL}" && curl --fail --location --silent ${URL2} > 
"${JAR_DL}")) &&\
+        mv "${JAR_DL}" "${JAR}"
     elif [ $(command -v wget) ]; then
-      (wget --quiet ${URL1} -O "${JAR_DL}" || wget --quiet ${URL2} -O 
"${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
+      (wget --quiet ${URL1} -O "${JAR_DL}" ||\
+        (rm -f "${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";
       exit -1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to