From: Ian Jackson Date: Tue, 29 Oct 2013 18:08:09 +0000 (+0000) Subject: cs-adjust-flight, mg-show-flight-runvars: support standalone mode (keying off whether... X-Git-Tag: wip.xsm-13-actual.base~415 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;p=people%2Fiwj%2Fosstest.git cs-adjust-flight, mg-show-flight-runvars: support standalone mode (keying off whether the flight is a pure number) --- diff --git a/cs-adjust-flight b/cs-adjust-flight index c4e77a2e..d937caac 100755 --- a/cs-adjust-flight +++ b/cs-adjust-flight @@ -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 { diff --git a/mg-show-flight-runvars b/mg-show-flight-runvars index db012dc0..62d5cba3 100755 --- a/mg-show-flight-runvars +++ b/mg-show-flight-runvars @@ -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