[Midnightbsd-cvs] mports [20531] trunk/Tools/magus/www: add top blockers to magus www interface
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Oct 17 16:48:43 EDT 2015
Revision: 20531
http://svnweb.midnightbsd.org/mports/?rev=20531
Author: laffer1
Date: 2015-10-17 16:48:42 -0400 (Sat, 17 Oct 2015)
Log Message:
-----------
add top blockers to magus www interface
Modified Paths:
--------------
trunk/Tools/magus/www/data/magus/index.cgi
Added Paths:
-----------
trunk/Tools/magus/www/tmpls/blockers.tmpl
Modified: trunk/Tools/magus/www/data/magus/index.cgi
===================================================================
--- trunk/Tools/magus/www/data/magus/index.cgi 2015-10-11 20:11:15 UTC (rev 20530)
+++ trunk/Tools/magus/www/data/magus/index.cgi 2015-10-17 20:48:42 UTC (rev 20531)
@@ -69,6 +69,8 @@
browse($p, $1);
} elsif ($path =~m:^/compare/:) {
compare_runs($p);
+ } elsif ($path =~m:^/blockers/(.*):) {
+ blockers($p, $1);
} else {
print $p->header(
-type=>'text/plain',
@@ -209,6 +211,39 @@
print $tmpl->output;
}
+sub blockers {
+ my ($p, $run) = @_;
+
+ my %objs;
+ my %blocking;
+ my $ports = Magus::Port->search(run => $run, status => 'untested');
+
+ my $tmpl = template($p, "blockers.tmpl");
+ $tmpl->param(title => "Top Blockers for Run $run");
+
+while (my $port = $ports->next) {
+ my $add = $blocking{$port} || 1;
+ $objs{$port} ||= $port;
+
+ foreach my $dep ($port->depends) {
+ next unless $dep->status eq 'fail' || $dep->status eq 'skip' || $dep->status eq 'untested';
+
+
+ $objs{$dep} ||= $dep;
+ $blocking{$dep} += $add;
+ }
+}
+
+my @blocks;
+foreach my $port (sort { $blocking{$b} <=> $blocking{$a} } keys %blocking) {
+ next if $objs{$port}->status eq 'untested';
+ push(@blocks, { port => $port, blocking => $blocking{$port} });
+}
+$tmpl->param(blocks => \@blocks);
+print $p->header;
+print $tmpl->output;
+}
+
sub run_page {
my ($p, $run) = @_;
Added: trunk/Tools/magus/www/tmpls/blockers.tmpl
===================================================================
--- trunk/Tools/magus/www/tmpls/blockers.tmpl (rev 0)
+++ trunk/Tools/magus/www/tmpls/blockers.tmpl 2015-10-17 20:48:42 UTC (rev 20531)
@@ -0,0 +1,30 @@
+<TMPL_INCLUDE NAME="header.tmpl">
+
+<section>
+ <div class="row-fluid">
+ <div class="col-md-10 col-md-offset-1">
+ <h2><TMPL_VAR NAME="title"></h2>
+
+ <p>Top blockers is a list of ports that were blocking the build of other
+ ports.</p>
+
+ <table class="table table-striped table-bordered run-summary">
+<thead>
+<tr>
+ <th>Port</th>
+ <th>Blocking</th>
+</tr>
+</thead>
+
+<TMPL_LOOP NAME="blocks">
+<tr>
+ <td><TMPL_VAR NAME="port"></td>
+ <td><TMPL_VAR NAME="blocking"></td>
+</tr>
+</TMPL_LOOP>
+</table>
+ </div>
+ </div>
+</section>
+
+<TMPL_INCLUDE NAME="footer.tmpl">
Property changes on: trunk/Tools/magus/www/tmpls/blockers.tmpl
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list