You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/03/23 07:59:28 UTC

[39/50] [abbrv] kylin git commit: KYLIN_1514 Fix MD5 validation of tomcat when package tar

KYLIN_1514 Fix MD5 validation of tomcat when package tar


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

Branch: refs/heads/master
Commit: f01876f24d0f26579bc53388a407208063eddee0
Parents: a6a0e7e
Author: lidongsjtu <li...@apache.org>
Authored: Tue Mar 22 10:06:41 2016 +0800
Committer: lidongsjtu <li...@apache.org>
Committed: Tue Mar 22 10:06:41 2016 +0800

----------------------------------------------------------------------
 build/script/download-tomcat.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/f01876f2/build/script/download-tomcat.sh
----------------------------------------------------------------------
diff --git a/build/script/download-tomcat.sh b/build/script/download-tomcat.sh
index e11aa6f..ea2b86e 100755
--- a/build/script/download-tomcat.sh
+++ b/build/script/download-tomcat.sh
@@ -22,18 +22,24 @@ cd ${dir}/../..
 
 rm -rf build/tomcat
 
+alias md5cmd="md5sum"
+if [[ `uname -a` =~ "Darwin" ]]; then
+    alias md5cmd="md5 -q"
+fi
+
 if [ ! -f "build/apache-tomcat-7.0.59.tar.gz" ]
 then
     echo "no binary file found"
     wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.59/bin/apache-tomcat-7.0.59.tar.gz || echo "download tomcat failed"
 else
-    if [ `md5sum apache-tomcat-7.0.59.tar.gz | awk '{print $1}'` != "ec570258976edf9a833cd88fd9220909" ]
+    if [ `md5cmd build/apache-tomcat-7.0.59.tar.gz | awk '{print $1}'` != "ec570258976edf9a833cd88fd9220909" ]
     then
         echo "md5 check failed"
-        rm apache-tomcat-7.0.59.tar.gz
+        rm build/apache-tomcat-7.0.59.tar.gz
         wget --directory-prefix=build/ http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.59/bin/apache-tomcat-7.0.59.tar.gz || echo "download tomcat failed"
     fi
 fi
+unalias md5cmd
 
 tar -zxvf build/apache-tomcat-7.0.59.tar.gz -C build/
 mv build/apache-tomcat-7.0.59 build/tomcat