]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
cs-adjust-flight: allow creation
authorIan Jackson <iwj@woking.cam.xci-test.com>
Thu, 7 Mar 2013 18:06:01 +0000 (18:06 +0000)
committerIan Jackson <iwj@woking.cam.xci-test.com>
Thu, 7 Mar 2013 18:06:01 +0000 (18:06 +0000)
Osstest.pm
cs-adjust-flight

index b1c02ee07daec87705e5d65ba82cd975731186f3..9ba2882d653775d51364d12a54be36bb16e71f30 100644 (file)
@@ -178,6 +178,8 @@ sub readglobalconfig () {
 
     $c{OverlayLocal} ||= "overlay-local";
     $c{GuestDebianSuite} ||= $c{DebianSuite};
+
+    $c{DefaultBranch} ||= 'xen-unstable';
 }
 
 sub augmentconfigdefaults {
index 110d549caeae4788e9b41d583b04db1d9bee25e5..725470efb0882e569660538b6954bd189ad0ec90 100755 (executable)
@@ -56,7 +56,9 @@ while (@ARGV && $ARGV[0] =~ m/^\-/) {
 }
 
 die unless @ARGV >= 1;
-my ($dstflight,@changes) = @ARGV;
+our ($dstflightspec,@changes) = @ARGV;
+
+our $dstflight;
 
 sub spec_re ($) {
     my ($spec) = @_;
@@ -283,7 +285,21 @@ sub changes () {
 }
 
 sub main () {
-    db_retry($dstflight,'constructing', $dbh_tests,[qw(flights)], \&changes);
+    if ($dstflightspec =~ m/^\d+$/) {
+        $dstflight = $dstflightspec;
+        db_retry($dstflight,'constructing',
+                 $dbh_tests, [qw(flights)], \&changes);
+    } elsif ($dstflightspec =~ m/^new:/) {
+        my $intended = $'; #';
+        db_retry($dbh_tests, [qw(flights)], sub {
+            $dstflight = $mjobdb->flight_create($intended, $c{DefaultBranch});
+            $mjobdb->dbfl_check($dstflight, 'constructing');
+            changes();
+        });
+        print "$dstflight\n" or die $!;
+    } else {
+        die "$dstflightspec ?";
+    }
 }
 
 main();