svn commit: r266154 - user/des/tinderbox

Dag-Erling Smørgrav des at FreeBSD.org
Thu May 15 16:22:10 UTC 2014


Author: des
Date: Thu May 15 16:22:09 2014
New Revision: 266154
URL: http://svnweb.freebsd.org/changeset/base/266154

Log:
  Factor out common code for the revert and update commands.

Modified:
  user/des/tinderbox/tinderbox.pl

Modified: user/des/tinderbox/tinderbox.pl
==============================================================================
--- user/des/tinderbox/tinderbox.pl	Thu May 15 16:17:21 2014	(r266153)
+++ user/des/tinderbox/tinderbox.pl	Thu May 15 16:22:09 2014	(r266154)
@@ -621,6 +621,10 @@ MAIN:{
     if ($cmds{'revert'} || $cmds{'version'} || $cmds{'update'}) {
 	$svncmd = [grep({ -x } @svncmds)]->[0]
 	    or error("unable to locate svn binary");
+	if (-d "$srcdir/.svn") {
+	    spawn($svncmd, "upgrade", $srcdir);
+	    spawn($svncmd, "cleanup", $srcdir);
+	}
     }
 
     # Revert sources
@@ -629,8 +633,6 @@ MAIN:{
 	push(@svnargs, "--quiet")
 	    unless ($verbose);
 	logstage("reverting $srcdir");
-	spawn($svncmd, @svnargs, "upgrade", $srcdir);
-	spawn($svncmd, @svnargs, "cleanup", $srcdir);
 	spawn($svncmd, @svnargs, "revert", "-R", $srcdir)
 	    or error("unable to revert the source tree");
 	# remove leftovers...  ugly!
@@ -674,8 +676,6 @@ MAIN:{
 	cd("$sandbox");
 	for (0..$svnattempts) {
 	    if (-d "$srcdir/.svn") {
-		spawn($svncmd, "upgrade", $srcdir);
-		spawn($svncmd, "cleanup", $srcdir);
 		last if spawn($svncmd, @svnargs, "update", $srcdir);
 	    } else {
 		last if spawn($svncmd, @svnargs, "checkout", $svnbase, $srcdir);
@@ -685,6 +685,7 @@ MAIN:{
 	    my $delay = 30 * ($_ + 1);
 	    warning("sleeping $delay s and retrying...");
 	    sleep($delay);
+	    spawn($svncmd, "cleanup", $srcdir);
 	}
     }
 


More information about the svn-src-user mailing list