kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject kudu git commit: build: Make 'download-thirdparty.sh' resilient to failure
Date Mon, 08 Aug 2016 19:09:32 GMT
Repository: kudu
Updated Branches:
  refs/heads/master d60923c91 -> eaa15dea6


build: Make 'download-thirdparty.sh' resilient to failure

Many contributors work at home on flaky internet connections. This
change does two things:

 - Use gtar on Mac, if available, as I've found it more resilient to
   failures than bsdtar. For example, I just spent 20 minutes debugging
   a build failure in cmake which was due to a truncated tar.

 - Exit if the script doesn't successfully extract, currently a warning
   prefixed with "Error" is logged but the process is left to fail with
   some unknown error later on

Change-Id: Ied07d236b1c9cd2eb78aef7ad372f8d835e09782
Reviewed-on: http://gerrit.cloudera.org:8080/3857
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <todd@apache.org>


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

Branch: refs/heads/master
Commit: eaa15dea662a978d246f5f99321215a7f08416c8
Parents: d60923c
Author: Brock Noland <brock@phdata.io>
Authored: Sun Aug 7 15:58:54 2016 -0500
Committer: Todd Lipcon <todd@apache.org>
Committed: Mon Aug 8 19:09:18 2016 +0000

----------------------------------------------------------------------
 thirdparty/download-thirdparty.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/eaa15dea/thirdparty/download-thirdparty.sh
----------------------------------------------------------------------
diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh
index 147c52b..c3b4f63 100755
--- a/thirdparty/download-thirdparty.sh
+++ b/thirdparty/download-thirdparty.sh
@@ -48,6 +48,11 @@ fetch_and_expand() {
     exit 1
   fi
 
+  TAR_CMD=tar
+  if [[ "$OSTYPE" == "darwin"* ]] && which gtar &>/dev/null; then
+    TAR_CMD=gtar
+  fi
+
   FULL_URL="${CLOUDFRONT_URL_PREFIX}/${FILENAME}"
   SUCCESS=0
   # Loop in case we encounter a corrupted archive and we need to re-download it.
@@ -67,7 +72,7 @@ fetch_and_expand() {
         continue
       fi
     elif [[ "$FILENAME" =~ \.(tar\.gz|tgz)$ ]]; then
-      if ! tar xf "$FILENAME"; then
+      if ! $TAR_CMD xf "$FILENAME"; then
         echo "Error untarring $FILENAME, removing file"
         rm "$FILENAME"
         continue
@@ -83,6 +88,7 @@ fetch_and_expand() {
 
   if [ $SUCCESS -ne 1 ]; then
     echo "Error: failed to fetch and unpack $FILENAME"
+    exit 1
   fi
 
   # Allow for not removing previously-downloaded artifacts.


Mime
View raw message