Code

tinderbox: Don't alter SunOS path if we're building off a repository tree
[nagiosplug.git] / tools / tinderbox_build
index e8a3e2e09e8fad0cd9b4b8d5e84eec82d3897bf1..5035b60374fc6a61fd68b7c4cee112ccf0ab4f9d 100755 (executable)
@@ -14,7 +14,7 @@ use Sys::Hostname;
 use Cwd;
 use Time::Local;
 
-my $Version = '$Revision$';
+my $Version = `git describe --abbrev=4 HEAD`;
 
 my $myhost = hostname;
 chomp($myhost);
@@ -29,7 +29,9 @@ my $ReportStatus = 0;  # Do not send results to server
 # Set these to what makes sense for your system
 
 # Set these proper values for your tinderbox server
-my $Tinderbox_server = 'tinderbox2@tinderbox.altinity.org';
+# Have the StrictHostKeyChecking=no so that a new host will automatically add hostkey without
+# prompting. If host key changes, then will get error, so this should still be secure
+my $Tinderbox_server = '-p 1022 -o StrictHostKeyChecking=no tinderbox2@tinderbox.opsera.com';
 
 # These shouldn't really need to be changed
 my $BuildTree = 'nagiosplug';
@@ -82,7 +84,7 @@ sub BuildIt {
        if (-e (my $file = "nagios-plugins.spec")) {
                open F, $file;
                while (<F>) {
-                       if (/^Version: HEAD-(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
+                       if (/^Version: trunk-(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) {
                                $StartTime = timegm(0, $5, $4, $3, ($2 - 1), ($1 - 1900));
                                last;
                        }
@@ -232,8 +234,10 @@ sub SetupPath {
     $Path = $ENV{PATH};
     print "Path before: $Path\n";
 
-    if ( $OS eq 'SunOS' ) {
-       $ENV{'PATH'} = '/usr/ccs/bin:' . $ENV{'PATH'};
+    # Don't alter path if we're building off a repository tree;
+    # SunOS make will work only out of snapshots and releases.
+    if ( $OS eq 'SunOS' && !( -e '.svn' || -e '.git' )) {
+        $ENV{'PATH'} = '/usr/ccs/bin:' . $ENV{'PATH'};
     }
 
     $Path = $ENV{PATH};
@@ -242,8 +246,8 @@ sub SetupPath {
 
 sub configure {
        # Configure
-        print LOG "./configure --enable-libtap $ConfigureArgs\n";
-        open (CONFIGURE, "./configure --enable-libtap $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
+        print LOG "./configure $ConfigureArgs\n";
+        open (CONFIGURE, "./configure $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
         while (<CONFIGURE>) {
             print $_;
             print LOG $_;