]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
cs-adjust-flight, mg-show-flight-runvars: support standalone mode (keying off whether... master
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 29 Oct 2013 18:08:09 +0000 (18:08 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 29 Oct 2013 18:08:09 +0000 (18:08 +0000)
cs-adjust-flight
mg-show-flight-runvars

index c4e77a2e7d4434777f8cfda351b96326301b987a..d937caaca9e6509237c2eaee61a7dc2ac951efd8 100755 (executable)
@@ -297,10 +297,13 @@ sub change__branch {
 sub changes () {
     debug("CHANGES...\n");
 
-    my $steps_q = $dbh_tests->prepare("SELECT * FROM steps WHERE flight = ?");
-    $steps_q->execute($dstflight);
-    my $step = $steps_q->fetchrow_hashref();
-    die "$dstflight already has steps\n".Dumper($step) if $step;
+    if ($dstflight =~ m/^\d+$/) {
+       my $steps_q =
+           $dbh_tests->prepare("SELECT * FROM steps WHERE flight = ?");
+       $steps_q->execute($dstflight);
+       my $step = $steps_q->fetchrow_hashref();
+       die "$dstflight already has steps\n".Dumper($step) if $step;
+    }
 
     while (@changes) {
         my $change = shift @changes;
@@ -310,7 +313,7 @@ sub changes () {
 }
 
 sub main () {
-    if ($dstflightspec =~ m/^\d+$/) {
+    if ($dstflightspec =~ m/^\w+$/) {
         $dstflight = $dstflightspec;
         db_retry($dstflight,'constructing',
                  $dbh_tests, [qw(flights)], sub {
index db012dc04ff4fc1d0289543b4e1a731a6a83f921..62d5cba32803d13d5ee967d4d58ac0f02d1f9960 100755 (executable)
@@ -39,12 +39,13 @@ for (;;) {
     }
 }
 
-die unless @ARGV==1 && $ARGV[0] =~ m/^\d+/;
+die unless @ARGV==1 && $ARGV[0] =~ m/^\w+$/;
 
 our ($flight) = @ARGV;
 
 our @cols = qw(job name val);
 
+$flight =~ m/^\d+/ or $flight = "'$flight'";
 my $qfrom = "FROM runvars WHERE flight=$flight AND $synthcond";
 
 my @colws = $dbh_tests->selectrow_array