author reports able to be made

This commit is contained in:
Your Name 2017-04-14 02:00:32 -04:00
parent 9a8857203b
commit a340a97095
4 changed files with 52 additions and 0 deletions

2
.gitignore vendored
View file

@ -2,3 +2,5 @@ cache.stor
*.swp
logs/*
#*.stor
reports/files/
*.html

Binary file not shown.

48
reports/author.pl Executable file
View file

@ -0,0 +1,48 @@
#!/usr/bin/env perl
use v5.24.0;
use strict;
#use warnings;
use Data::Dumper;
use Storable;
use lib '../lib';
use Dist;
use Template;
my $data = retrieve '../everything.stor';
my %auths;
for my $mod ($data->{modules}->@*) {
my ($tested, $status) = $data->{jobstatus}{$mod}->@{qw/tested status/};
$tested = !!$tested ? "yes" : "no";
$status //= "";
my $log = "";
if ($status && $status ne 'success') {
my $failure = $status =~ /inc/ ? 'incfailure' : 'genfailure';
$log = "<a href='/logs/${mod}_$failure.log'>here</a>"
}
my $author = Dist::get_author($mod) // '__UNKNOWN__';
push $auths{$author}->@*, {
name => $mod,
author => $author,
status => $status,
tested => $tested,
dist => $Dist::mod_to_dist{$mod} // $mod,
log => $log
};
}
my $tt = Template->new();
for my $auth (keys %auths) {
my $vars = {
modules => $auths{$auth},
};
$tt->process('template.tt.html', $vars, "files/$auth.html");
}

View file

@ -36,6 +36,8 @@ for my $mod ($data->{modules}->@*) {
my $author = Dist::get_author($mod);
next unless $status =~ /inc/;
push @mods, {
name => $mod,
author => $author,