URI escape branch names in URLs. Don't strip + from branch name.
[buildfarm-server.git] / cgi-bin / show_status.pl
index baf9623197acae357d3ad9f7606a7abcb035bf8b..6bc9fc6c04c10e41872b28beceacada75bae595d 100755 (executable)
@@ -71,8 +71,39 @@ while (my $row = $sth->fetchrow_hashref)
     $row->{build_flags}  =~ s/_PC\b//g;
     $row->{build_flags} = lc($row->{build_flags});
     if (defined($row->{log_text}))
-      {                # convert to a hash
-      $row->{log_text} = { split /\s+/, $row->{log_text} };
+      {                # convert to a hash, find ranges, output list of ranges
+      my $h = { split /\s+/, $row->{log_text} };
+      my $i;
+      my $start;
+      my @ranges;
+
+      foreach my $k (sort {$a<=>$b} keys %$h)
+       {
+       if (defined $start)
+         {
+         if ($h->{$k} ne $h->{$start})
+           {
+           push @ranges, sprintf("%s %s %s", $h->{$start},  $start,  $i);
+           $start = $k;
+           $i = 1;
+           }
+         else
+           {
+           $i++;
+           }
+         }
+       else
+         {
+         $start = $k;
+         $i = 1;
+         }
+       }
+      if (defined $start)
+       {
+        push @ranges, sprintf("%s %s %s", $h->{$start},  $start,  $i);
+       }
+
+      $row->{log_text} = \@ranges;
       }
     push(@$statrows,$row);
 }