]> xenbits.xensource.com Git - osstest.git/commitdiff
cs-bisection-step: break out $checkbasisvcs
authorIan Jackson <iwj@woking.cam.xci-test.com>
Fri, 1 Mar 2013 17:02:25 +0000 (17:02 +0000)
committerIan Jackson <iwj@woking.cam.xci-test.com>
Fri, 1 Mar 2013 17:02:25 +0000 (17:02 +0000)
cs-bisection-step

index e4ee3b5a5f4b620efb722741965ec72779000bb1..2955f28aa657709ac6cefe8e82801b56e6feff3f 100755 (executable)
@@ -348,17 +348,9 @@ END
        my $failrmap = flight_rmap($tryfail->{flight});
        next unless $failrmap;
 
-        print STDERR "/";
-        my ($basisrow,$trybasis);
-        $basisq->execute($job,$testid,$branch);
-        while ($trybasis= $basisq->fetchrow_hashref()) {
-            print STDERR " $trybasis->{flight}";
-            my $basishosts= relevant_hosts($trybasis->{flight});
-            if ($basishosts ne $failhosts) {
-                print STDERR " [$basishosts]";
-                next;
-            }
-           my $basisrmap = flight_rmap($trybasis->{flight});
+       my $checkbasisvcs = sub {
+           my ($trybasisflight) = @_;
+           my $basisrmap = flight_rmap($trybasisflight);
            my @bad;
 #print STDERR Dumper($failrmap, $basisrmap);
            foreach my $tree (keys %$failrmap) {
@@ -366,16 +358,29 @@ END
                my $basisvcs = $basisrmap->{$tree}{Url};
 #print STDERR Dumper($failvcs, $basisvcs);
                next unless defined $basisvcs;
-               $failvcs=~ s/.*(\.\w+)$/$1/ or warn"$tryfail->{flight} $tree ";
-               $basisvcs=~s/.*(\.\w+)$/$1/ or warn"$trybasis->{flight} $tree ";
+               $failvcs=~ s/.*(\.\w+)$/$1/ or warn "$tryfail->{flight} $tree ";
+               $basisvcs=~s/.*(\.\w+)$/$1/ or warn "$trybasisflight $tree ";
 #print STDERR "COMPARE $failvcs $basisvcs\n";
                push @bad, "$tree:<$failvcs>/<$basisvcs>"
                     if $failvcs ne $basisvcs;
            }
-           if (@bad) {
-               print STDERR " (vcs mismatch: @bad)";
-               next;
-           }
+           print STDERR " (vcs mismatch: @bad)"
+               if @bad;
+           return @bad;
+       };
+
+        print STDERR "/";
+        my ($basisrow,$trybasis);
+        $basisq->execute($job,$testid,$branch);
+        while ($trybasis= $basisq->fetchrow_hashref()) {
+            print STDERR " $trybasis->{flight}";
+            my $basishosts= relevant_hosts($trybasis->{flight});
+            if ($basishosts ne $failhosts) {
+                print STDERR " [$basishosts]";
+                next;
+            }
+           my @bad = $checkbasisvcs->($trybasis->{flight});
+           next if @bad;
             $basisrow= $trybasis;
             last;
         }