Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Oct 2013 08:53:27 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r256311 - user/des/tinderbox/www
Message-ID:  <201310110853.r9B8rRNL032526@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Fri Oct 11 08:53:27 2013
New Revision: 256311
URL: http://svnweb.freebsd.org/changeset/base/256311

Log:
  Restructure the outer and inner loop so results are sorted first
  numerically by branch rank, then alphabetically by variant.

Modified:
  user/des/tinderbox/www/index.cgi

Modified: user/des/tinderbox/www/index.cgi
==============================================================================
--- user/des/tinderbox/www/index.cgi	Fri Oct 11 07:22:26 2013	(r256310)
+++ user/des/tinderbox/www/index.cgi	Fri Oct 11 08:53:27 2013	(r256311)
@@ -32,7 +32,7 @@ use strict;
 use POSIX qw(strftime);
 use Sys::Hostname;
 
-my %CONFIGS;
+my %BRANCHES;
 my %ARCHES;
 
 my $DIR = ".";
@@ -79,13 +79,14 @@ sub inverse_branch_sort($$) {
     return branch_rank($b) cmp branch_rank($a);
 }
 
-sub do_config($) {
-    my ($config) = @_;
+sub do_branch($) {
+    my ($branch) = @_;
 
-    my %branches = %{$CONFIGS{$config}};
+    my $prettybranch = $branch;
+    $prettybranch =~ s@^HEAD$@head@;
+    $prettybranch =~ s@^RELENG_(\d+)_(\d+)$@releng/$1.$2@;
+    $prettybranch =~ s@^RELENG_(\d+)$@stable/$1@;
 
-    $config =~ m/^(\w+)((?:-\w+)*?)(-build)?$/;
-    my $variant = join(' ', split('-', $2));
     print "      <tr class='header'>
         <th>&nbsp;</th>
 ";
@@ -102,13 +103,11 @@ sub do_config($) {
 
     my $now = time();
 
-    foreach my $branch (sort(inverse_branch_sort keys(%branches))) {
-	my $prettybranch = $branch;
-	$prettybranch =~ s@^HEAD$@/head@;
-	$prettybranch =~ s@^RELENG_(\d+)_(\d+)$@/releng/$1.$2@;
-	$prettybranch =~ s@^RELENG_(\d+)$@/stable/$1@;
+    foreach my $config (sort(keys(%{$BRANCHES{$branch}}))) {
+	$config =~ m/^(\w+)((?:-\w+)*?)(-build)?$/;
+	my $variant = $2 =~ s/^-//r;
 	print "      <tr>
-	<th>$prettybranch$variant</th>
+	<th>$prettybranch" . ($variant ? "<br/>($variant)" : "") . "</th>
 ";
 	foreach my $arch (sort(keys(%ARCHES))) {
 	    foreach my $machine (sort(keys(%{$ARCHES{$arch}}))) {
@@ -164,7 +163,7 @@ MAIN:{
 	or die("$DIR: $!\n");
     foreach (readdir(DIR)) {
 	next unless m/^tinderbox-([\w-]+)-(\w+)-(\w+)-(\w+)\.(brief|full)$/;
-	$CONFIGS{$1}->{$2} = $ARCHES{$3}->{$4} = 1;
+	$BRANCHES{$2}->{$1} = $ARCHES{$3}->{$4} = 1;
     }
     closedir(DIR);
 
@@ -197,9 +196,8 @@ MAIN:{
     }
 
     # Generate rows
-    foreach my $config (sort(inverse_branch_sort keys(%CONFIGS))) {
-	next if $config =~ m/^update_/;
-	do_config($config);
+    foreach my $branch (sort(inverse_branch_sort keys(%BRANCHES))) {
+	do_branch($branch);
     }
 
     print "



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310110853.r9B8rRNL032526>