Repository: kylin
Updated Branches:
  refs/heads/master 483a8806a -> 2850586c8


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/2850586c
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2850586c
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2850586c

Branch: refs/heads/master
Commit: 2850586c85a4df26843d8df5d175ea209f613639
Parents: 483a880
Author: lidongsjtu <[email protected]>
Authored: Tue Mar 22 10:06:41 2016 +0800
Committer: lidongsjtu <[email protected]>
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/2850586c/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

Reply via email to