Repository: spark
Updated Branches:
  refs/heads/branch-1.1 a8c6e82de -> 06b96d4a3


SPARK-3745 - fix check-license to properly download and check jar

for details, see: https://issues.apache.org/jira/browse/SPARK-3745

Author: shane knapp <[email protected]>

Closes #2596 from shaneknapp/SPARK-3745 and squashes the following commits:

c95eea9 [shane knapp] SPARK-3745 - fix check-license to properly download and 
check jar

(cherry picked from commit a01a30927d107a8d9496f749eb9d89eda6dda9d7)
Signed-off-by: Josh Rosen <[email protected]>

Conflicts:
        dev/check-license


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

Branch: refs/heads/branch-1.1
Commit: 06b96d4a3d6af64ade3e76d8cbee783e8a6e3fad
Parents: a8c6e82
Author: shane knapp <[email protected]>
Authored: Tue Sep 30 13:11:25 2014 -0700
Committer: Josh Rosen <[email protected]>
Committed: Tue Sep 30 13:28:08 2014 -0700

----------------------------------------------------------------------
 dev/check-license | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/06b96d4a/dev/check-license
----------------------------------------------------------------------
diff --git a/dev/check-license b/dev/check-license
index 625ec16..1f6a9b0 100755
--- a/dev/check-license
+++ b/dev/check-license
@@ -20,11 +20,10 @@
 
 acquire_rat_jar () {
 
-  
URL1="http://search.maven.org/remotecontent?filepath=org/apache/rat/apache-rat/${RAT_VERSION}/apache-rat-${RAT_VERSION}.jar";
-  
URL2="http://repo1.maven.org/maven2/org/apache/rat/apache-rat/${RAT_VERSION}/apache-rat-${RAT_VERSION}.jar";
+  
URL="http://repo1.maven.org/maven2/org/apache/rat/apache-rat/${RAT_VERSION}/apache-rat-${RAT_VERSION}.jar";
+
+  JAR="$rat_jar"
 
-  JAR=$rat_jar
-  
   if [[ ! -f "$rat_jar" ]]; then
     # Download rat launch jar if it hasn't been downloaded yet
     if [ ! -f "$JAR" ]; then
@@ -32,15 +31,17 @@ acquire_rat_jar () {
     printf "Attempting to fetch rat\n"
     JAR_DL=${JAR}.part
     if hash curl 2>/dev/null; then
-      (curl --progress-bar ${URL1} > "$JAR_DL" || curl --progress-bar ${URL2} 
> "$JAR_DL") && mv "$JAR_DL" "$JAR"
+      curl --silent "${URL}" > "$JAR_DL" && mv "$JAR_DL" "$JAR"
     elif hash wget 2>/dev/null; then
-      (wget --progress=bar ${URL1} -O "$JAR_DL" || wget --progress=bar ${URL2} 
-O "$JAR_DL") && mv "$JAR_DL" "$JAR"
+      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
-    if [ ! -f "$JAR" ]; then
+
+    unzip -tq $JAR &> /dev/null
+    if [ $? -ne 0 ]; then
       # We failed to download
       printf "Our attempt to download rat locally to ${JAR} failed. Please 
install rat manually.\n"
       exit -1
@@ -55,7 +56,7 @@ cd "$FWDIR"
 
 if test -x "$JAVA_HOME/bin/java"; then
     declare java_cmd="$JAVA_HOME/bin/java"
-else 
+else
     declare java_cmd=java
 fi
 


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

Reply via email to