Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Dec 2012 13:21:43 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r244434 - user/des/tinderbox
Message-ID:  <201212191321.qBJDLhvK003585@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Wed Dec 19 13:21:43 2012
New Revision: 244434
URL: http://svnweb.freebsd.org/changeset/base/244434

Log:
  Implement a new "version" target, which logs the state of the source tree
  after updating it but before building anything.  Bump $VERSION.

Modified:
  user/des/tinderbox/tbmaster.pl
  user/des/tinderbox/tinderbox.1
  user/des/tinderbox/tinderbox.pl

Modified: user/des/tinderbox/tbmaster.pl
==============================================================================
--- user/des/tinderbox/tbmaster.pl	Wed Dec 19 13:20:20 2012	(r244433)
+++ user/des/tinderbox/tbmaster.pl	Wed Dec 19 13:21:43 2012	(r244434)
@@ -33,7 +33,7 @@ use Fcntl qw(:DEFAULT :flock);
 use POSIX;
 use Getopt::Long;
 
-my $VERSION	= "2.9";
+my $VERSION	= "2.10";
 my $COPYRIGHT	= "Copyright (c) 2003-2012 Dag-Erling Smørgrav. " .
 		  "All rights reserved.";
 

Modified: user/des/tinderbox/tinderbox.1
==============================================================================
--- user/des/tinderbox/tinderbox.1	Wed Dec 19 13:20:20 2012	(r244433)
+++ user/des/tinderbox/tinderbox.1	Wed Dec 19 13:21:43 2012	(r244434)
@@ -283,6 +283,9 @@ but at the end of each job.
 As
 .Cm precleanroot ,
 but at the end of each job.
+.It Cm version
+After updating and patching the source tree but before doing anything
+else, log information about the current state of the source tree.
 .El
 .Pp
 The commands are executed in the order in which they are listed above,

Modified: user/des/tinderbox/tinderbox.pl
==============================================================================
--- user/des/tinderbox/tinderbox.pl	Wed Dec 19 13:20:20 2012	(r244433)
+++ user/des/tinderbox/tinderbox.pl	Wed Dec 19 13:21:43 2012	(r244434)
@@ -33,7 +33,7 @@ use Fcntl qw(:DEFAULT :flock);
 use POSIX;
 use Getopt::Long;
 
-my $VERSION	= "2.9";
+my $VERSION	= "2.10";
 my $COPYRIGHT	= "Copyright (c) 2003-2012 Dag-Erling Smørgrav. " .
 		  "All rights reserved.";
 
@@ -71,6 +71,7 @@ my %cmds = (
     'kernels'	=> 0,
     'install'	=> 0,
     'release'	=> 0,
+    'version'	=> 0,
 );
 my %kernels;
 my %lint;
@@ -613,10 +614,6 @@ MAIN:{
 		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")
@@ -691,6 +688,24 @@ MAIN:{
 	}
     }
 
+    # Print source tree version information
+    if ($cmds{'version'}) {
+	if (defined($svnbase)) {
+	    my $svncmd = [grep({ -x } @svncmds)]->[0]
+		or error("unable to locate svn binary");
+	    my $svnversioncmd = [grep({ -x } @svnversioncmds)]->[0]
+		or error("unable to locate svnversion binary");
+	    if ($verbose) {
+		spawn($svncmd, "stat", $srcdir)
+		    or error("unable to stat source tree");
+	    }
+	    my $svnversion = `$svnversioncmd $srcdir`; # XXX
+	    message("At svn revision $svnversion");
+	} else {
+	    warning("the 'version' target is only supported for svn");
+	}
+    }
+
     # Prepare environment for make(1);
     %ENV = (
 	'TZ'			=> "UTC",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212191321.qBJDLhvK003585>