summaryrefslogtreecommitdiff
path: root/nightly
diff options
context:
space:
mode:
authorbart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-04-27 08:04:57 +0000
committerbart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9>2009-04-27 08:04:57 +0000
commit8286496161e7e54d7a1c4d4b68777bdcaed345e0 (patch)
treea58f956e62bb9d942b69619e46c9c6806747315b /nightly
parentace90d8001139c4fe973aa217e72e9265499bffc (diff)
Only run the nightly build if there was a commit during the last 24 hours.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9646 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'nightly')
-rwxr-xr-xnightly/bin/nightly29
1 files changed, 24 insertions, 5 deletions
diff --git a/nightly/bin/nightly b/nightly/bin/nightly
index 15ea07f7..8496da87 100755
--- a/nightly/bin/nightly
+++ b/nightly/bin/nightly
@@ -6,9 +6,14 @@
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
-# Helper function
+# Helper functions
#----------------------------------------------------------------------------
+# Returns the revision number of the source files with date $1.
+get_svn_revision() {
+ svn info -r "{$1}" "${valgrind_svn_repo}" | sed -n 's/^Revision: //p'
+}
+
runcmd () {
logfile=$1
str=$2
@@ -39,6 +44,9 @@ runcmd () {
#----------------------------------------------------------------------------
# Startup
#----------------------------------------------------------------------------
+
+valgrind_svn_repo="svn://svn.valgrind.org/valgrind/trunk"
+
# Must have exactly two arguments
if [ $# -ne 2 ] ; then
echo "usage: $0 /path/to/valgrind/nightly <tag>"
@@ -57,6 +65,10 @@ svn_new_date=`date --date=today +%Y-%m-%dT%H:%M:%S`
cd $ABT_TOP
+# Clean up output files produced by a previous run.
+rm -rf diffs diff.short final Inst new.short new.verbose old.short old.verbose
+rm -rf sendmail.log unchanged.log valgrind
+
# Setup any relevant environment variables from conf/<tag>.conf.
. conf/$ABT_MACHINE.conf
if [ "${ABT_JOBS}" = "" ]; then
@@ -74,12 +86,20 @@ fi
# Check out, build, test
#----------------------------------------------------------------------------
+svn_old_rev="`get_svn_revision ${svn_old_date}`"
+svn_new_rev="`get_svn_revision ${svn_new_date}`"
+if [ "${svn_old_rev}" = "${svn_new_rev}" ]; then
+ echo "Both {$svn_old_date} and {$svn_new_date} correspond to r${svn_new_rev}"\
+ "-- skipping nightly build." >unchanged.log
+ exit 0
+fi
+
# Do everything twice -- once for the 24 hours old Valgrind, and once
# for the current one.
for logfile in old new ; do
- # Remove the old valgrind/ and vex/ directories
- rm -rf valgrind vex
+ # Remove the old valgrind directory.
+ rm -rf valgrind
# Remove old short and verbose log files, and start the new ones
for ext in short verbose ; do
@@ -98,7 +118,7 @@ for logfile in old new ; do
# Check out, build, run tests
runcmd $logfile \
"Checking out valgrind source tree" \
- "svn co svn://svn.valgrind.org/valgrind/trunk -r {$svn_date} valgrind" && \
+ "svn co ${valgrind_svn_repo} -r {$svn_date} valgrind" && \
\
runcmd $logfile \
"Configuring valgrind " \
@@ -170,7 +190,6 @@ fi
# Gather up the diffs (at most the first 100 lines for each one) into a
# single file.
MAX_LINES=100
-rm -f diffs
diff_files=`find . -name '*.diff*' | sort`
if [ z"$diff_files" = z ] ; then
echo "Congratulations, all tests passed!" >> diffs