svn commit: r240888 - user/des/tinderbox

Dag-Erling Smørgrav des at FreeBSD.org
Mon Sep 24 15:15:42 UTC 2012


Author: des
Date: Mon Sep 24 15:15:41 2012
New Revision: 240888
URL: http://svn.freebsd.org/changeset/base/240888

Log:
  If svn checkout or update fails, retry up to three times (four attempts
  total) at increasing intervals before giving up.
  
  When svn checkout or update succeeds, use svnversion to retrieve the
  version number and log it so it appears in the summary.

Modified:
  user/des/tinderbox/tinderbox.pl

Modified: user/des/tinderbox/tinderbox.pl
==============================================================================
--- user/des/tinderbox/tinderbox.pl	Mon Sep 24 15:02:31 2012	(r240887)
+++ user/des/tinderbox/tinderbox.pl	Mon Sep 24 15:15:41 2012	(r240888)
@@ -95,6 +95,13 @@ my @svncmds = (
     '/usr/local/bin/svn',
 );
 
+my @svnversioncmds = (
+    '/usr/bin/svnversion',
+    '/usr/local/bin/svnversion',
+);
+
+my $svnattempts = 4;
+
 BEGIN {
     ($starttime) = POSIX::times();
 }
@@ -598,8 +605,18 @@ MAIN:{
 	    } else {
 		push(@svnargs, "checkout", $svnbase, $srcdir);
 	    }
-	    spawn($svncmd, @svnargs)
-		or error("unable to check out the source tree");
+	    for (0..$svnattempts) {
+		last if spawn($svncmd, @svnargs);
+		error("unable to check out the source tree")
+		    if ($_ == $svnattempts);
+		my $delay = 30 * ($_ + 1);
+		warning("sleeping $delay s and retrying...");
+		sleep($delay);
+	    }
+	    my $svnversioncmd = [grep({ -x } @svnversioncmds)]->[0]
+		or error("unable to locate svnversion binary");
+	    my $svnversion = `$svnversioncmd $srcdir`;
+	    message("At svn revision $svnversion");
 	} elsif (defined($cvsup)) {
 	    logstage("cvsupping the source tree");
 	    open(my $fh, ">", "$sandbox/supfile")


More information about the svn-src-user mailing list