|
From: <sv...@va...> - 2009-04-27 08:05:04
|
Author: bart
Date: 2009-04-27 09:04:57 +0100 (Mon, 27 Apr 2009)
New Revision: 9646
Log:
Only run the nightly build if there was a commit during the last 24 hours.
Modified:
trunk/nightly/bin/nightly
Modified: trunk/nightly/bin/nightly
===================================================================
--- trunk/nightly/bin/nightly 2009-04-27 04:59:02 UTC (rev 9645)
+++ trunk/nightly/bin/nightly 2009-04-27 08:04:57 UTC (rev 9646)
@@ -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 @@
#----------------------------------------------------------------------------
# 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 @@
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 @@
# 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 @@
# 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 @@
# 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
|