aboutsummaryrefslogtreecommitdiff
path: root/dev/check-license
diff options
context:
space:
mode:
authorshane knapp <incomplete@gmail.com>2014-09-30 13:11:25 -0700
committerJosh Rosen <joshrosen@apache.org>2014-09-30 13:11:25 -0700
commita01a30927d107a8d9496f749eb9d89eda6dda9d7 (patch)
tree3d1fa8a8bdd26ce5b62f1e80a439ff8acab088f9 /dev/check-license
parentab6dd80ba0f7e1042ea270d10400109a467fe40e (diff)
downloadspark-a01a30927d107a8d9496f749eb9d89eda6dda9d7.tar.gz
spark-a01a30927d107a8d9496f749eb9d89eda6dda9d7.tar.bz2
spark-a01a30927d107a8d9496f749eb9d89eda6dda9d7.zip
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 <incomplete@gmail.com> 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
Diffstat (limited to 'dev/check-license')
-rwxr-xr-xdev/check-license15
1 files changed, 8 insertions, 7 deletions
diff --git a/dev/check-license b/dev/check-license
index 9ff0929e9a..72b1013479 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"
-
+
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 --silent "${URL1}" > "$JAR_DL" || curl --silent "${URL2}" > "$JAR_DL") && mv "$JAR_DL" "$JAR"
+ curl --silent "${URL}" > "$JAR_DL" && mv "$JAR_DL" "$JAR"
elif hash wget 2>/dev/null; then
- (wget --quiet ${URL1} -O "$JAR_DL" || wget --quiet ${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