sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject sentry git commit: SENTRY-1297: wget is not a default command on mac(Zephyr Guo via Colin Ma)
Date Thu, 26 May 2016 08:45:58 GMT
Repository: sentry
Updated Branches:
  refs/heads/master 47b437544 -> ee15429a5


SENTRY-1297: wget is not a default command on mac(Zephyr Guo via Colin Ma)


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

Branch: refs/heads/master
Commit: ee15429a57dc8328227a902e7bd8e73a027ef32f
Parents: 47b4375
Author: Colin Ma <colin@apache.org>
Authored: Thu May 26 17:24:33 2016 +0800
Committer: Colin Ma <colin@apache.org>
Committed: Thu May 26 17:24:33 2016 +0800

----------------------------------------------------------------------
 sentry-tests/sentry-tests-sqoop/pom.xml | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/ee15429a/sentry-tests/sentry-tests-sqoop/pom.xml
----------------------------------------------------------------------
diff --git a/sentry-tests/sentry-tests-sqoop/pom.xml b/sentry-tests/sentry-tests-sqoop/pom.xml
index 29c4670..c494b5a 100644
--- a/sentry-tests/sentry-tests-sqoop/pom.xml
+++ b/sentry-tests/sentry-tests-sqoop/pom.xml
@@ -187,12 +187,21 @@ limitations under the License.
                   /bin/pwd
                   BASE_DIR=./target
                   DOWNLOAD_DIR=./thirdparty
+                  if which wget >/dev/null; then
+                    DOWNLOAD_CMD="wget --no-check-certificate -nv -O"
+                  elif which curl >/dev/null; then
+                    DOWNLOAD_CMD="curl -sS -o"
+                  fi
+                  if [ -z $DOWNLOAD_CMD ]; then
+                    echo "Can't find command 'wget' or 'curl'"
+                    exit 1
+                  fi
                   download() {
                     url=$1;
                     packageName=$2
                     if [[ ! -f $DOWNLOAD_DIR/$packageName ]]
                     then
-                      wget --no-check-certificate -nv -O $DOWNLOAD_DIR/$packageName $url
+                      $DOWNLOAD_CMD $DOWNLOAD_DIR/$packageName $url
                     fi
                   }
                   mkdir -p $DOWNLOAD_DIR


Mime
View raw message