summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 08:49:34 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 08:49:34 +0000
commite93620db3d49016aa26aba602baef70f6265c09a (patch)
treeaa8775955a1c27b90f5e7ae866bdf8727c97c9f7 /tools
parent286f624acd2ba87f462052513c128385caae3311 (diff)
downloadchromium_src-e93620db3d49016aa26aba602baef70f6265c09a.zip
chromium_src-e93620db3d49016aa26aba602baef70f6265c09a.tar.gz
chromium_src-e93620db3d49016aa26aba602baef70f6265c09a.tar.bz2
Cleanup waterfall.sh.
Use /bin/bash instead of /bin/sh Use either curl or wget, depending on what is installed Bail out of a download fails BUG=none TEST=none Review URL: http://codereview.chromium.org/3142003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/valgrind/waterfall.sh34
1 files changed, 29 insertions, 5 deletions
diff --git a/tools/valgrind/waterfall.sh b/tools/valgrind/waterfall.sh
index 4b04efa..246c8318 100755
--- a/tools/valgrind/waterfall.sh
+++ b/tools/valgrind/waterfall.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
@@ -13,6 +13,30 @@ set -e
THISDIR=$(dirname "${0}")
LOGS_DIR=$THISDIR/waterfall.tmp
+download() {
+ # Download a file.
+ # $1 = URL to download
+ # $2 = Path to the output file
+ # {{{1
+ if [ x$(which curl) != x ]; then
+ if ! curl -s -o "$2" "$1" ; then
+ echo
+ echo "Failed to download '$1'... aborting"
+ exit 1
+ fi
+ elif [ x$(which wget) != x ]; then
+ if ! wget "$1" -O "$2" -q ; then
+ echo
+ echo "Failed to download '$1'... aborting"
+ exit 1
+ fi
+ else
+ echo "Need either curl or wget to download stuff... aborting"
+ exit 1
+ fi
+ # }}}
+}
+
fetch_logs() {
# Fetch Valgrind logs from the waterfall {{{1
@@ -22,7 +46,7 @@ fetch_logs() {
mkdir "$LOGS_DIR"
echo "Fetching the list of builders..."
- wget $WATERFALL_PAGE -O "$LOGS_DIR/builders" -q
+ download $WATERFALL_PAGE "$LOGS_DIR/builders"
SLAVES=$(grep "<a href=\"builders\/" "$LOGS_DIR/builders" | \
sed "s/.*<a href=\"builders\///" | sed "s/\".*//" | \
sort | uniq)
@@ -32,7 +56,7 @@ fetch_logs() {
SLAVE_URL=$WATERFALL_PAGE/$S
SLAVE_NAME=$(echo $S | sed "s/%20/ /g" | sed "s/%28/(/g" | sed "s/%29/)/g")
echo -n "Fetching builds by slave '${SLAVE_NAME}'"
- wget $SLAVE_URL -O "$LOGS_DIR/slave_${S}" -q
+ download $SLAVE_URL "$LOGS_DIR/slave_${S}"
# We speed up the 'fetch' step by skipping the builds/tests which succeeded.
# TODO(timurrrr): OTOH, we won't be able to check
@@ -44,7 +68,7 @@ fetch_logs() {
for BUILD in $LIST_OF_BUILDS
do
BUILD_RESULTS="$LOGS_DIR/slave_${S}_build_${BUILD}"
- wget $SLAVE_URL/builds/$BUILD -O "$BUILD_RESULTS" -q
+ download $SLAVE_URL/builds/$BUILD "$BUILD_RESULTS"
LIST_OF_TESTS=$(grep "<a href=\"[0-9]\+/steps/memory.*/logs/stdio\"" \
"$BUILD_RESULTS" | \
sed "s/.*a href=\"//" | sed "s/\".*//")
@@ -53,7 +77,7 @@ fetch_logs() {
REPORT_FILE=$(echo "report_${S}_$TEST" | sed "s/\/logs\/stdio//" | \
sed "s/\/steps//" | sed "s/\//_/g")
echo -n "."
- wget $SLAVE_URL/builds/$TEST -O "$LOGS_DIR/$REPORT_FILE" -q
+ download $SLAVE_URL/builds/$TEST "$LOGS_DIR/$REPORT_FILE"
echo $SLAVE_URL/builds/$TEST >> "$LOGS_DIR/$REPORT_FILE"
done
done