X-Git-Url: https://git.exim.org/buildfarm-server.git/blobdiff_plain/a411ba172dede5036f2adfdb3d6ec3afa0a6b865..7a251a65acd9d84242e15b47fd7c01405322b2ed:/cgi-bin/show_members.pl diff --git a/cgi-bin/show_members.pl b/cgi-bin/show_members.pl index 31b61dc..f6fb396 100755 --- a/cgi-bin/show_members.pl +++ b/cgi-bin/show_members.pl @@ -7,7 +7,7 @@ use Template; -use vars qw($dbhost $dbname $dbuser $dbpass $dbport $sort_by); +use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir $sort_by); require "$ENV{BFConfDir}/BuildFarmWeb.pl"; @@ -26,27 +26,32 @@ my $dsn="dbi:Pg:dbname=$dbname"; $dsn .= ";host=$dbhost" if $dbhost; $dsn .= ";port=$dbport" if $dbport; -my $db = DBI->connect($dsn,$dbuser,$dbpass); +my $db = DBI->connect($dsn,$dbuser,$dbpass,{pg_expand_array => 0}); # there is possibly some redundancy in this query, but it makes # a lot of the processing simpler. -my $statement = < 'HEAD', branch desc - ) as branches + ) as branches, + ARRAY(select compiler_version || '\t' || os_version || '\t' || effective_date + from personality p + where p.name = s.name + order by effective_date + ) as personalities from buildsystems s where status = 'approved' - order by $sort_by +}; -EOS -; +$statement .= "order by $sort_by"; my $statrows=[]; my $sth=$db->prepare($statement); @@ -54,6 +59,21 @@ $sth->execute; while (my $row = $sth->fetchrow_hashref) { $row->{branches} =~ s/^\{(.*)\}$/$1/; + my $personalities = $row->{personalities}; + $personalities =~ s/^\{(.*)\}$/$1/; + my @personalities = split(',',$personalities); + $row->{personalities} = []; + foreach my $personality (@personalities) + { + $personality =~ s/^"(.*)"$/$1/; + $personality =~ s/\\(.)/$1/g; + + my ($compiler_version, $os_version, $effective_date) = split(/\t/,$personality); + $effective_date =~ s/ .*//; + push(@{$row->{personalities}}, {compiler_version => $compiler_version, + os_version => $os_version, + effective_date => $effective_date }); + } $row->{owner_email} =~ s/\@/ [ a t ] /; push(@$statrows,$row); } @@ -65,106 +85,13 @@ $db->disconnect; # use Data::Dumper; print "Content-Type: text/plain\n\n",Dumper($statrows),"VERSION: ",$DBD::Pg::VERSION,"\n"; exit; -my $template = new Template({}); +my $template_opts = { INCLUDE_PATH => $template_dir}; +my $template = new Template($template_opts); print "Content-Type: text/html\n\n"; -$template->process(\*DATA,{statrows=>$statrows}); +$template->process('members.tt', + {statrows=>$statrows}); exit; - -__DATA__ - - - - - PostgreSQL BuildFarm Members - - - - - - -
- -
-

PostgreSQL BuildFarm Members

-

Click branch links to see build history. Click the heading links to resort the list. Select members by checkbox and hit the button at the bottom to create a status custom filter.

-
- - - - - - - - - -[% alt = true %] -[% FOREACH row IN statrows ; - have_recent = 0; - FOREACH branch_days IN row.branches.split(',') ; - branch_fields = branch_days.split(':'); - branch_day = branch_fields.1; - IF branch_day < 365 ; have_recent = 1; END; - END; - IF have_recent ; -%] - [% alt = ! alt %] - - - - - - - -[% END; END %] -
 Name
Owner
OS / VersionCompiler / VersionArchBranches reported on
(most recent report)
[% row.name %]
[% row.owner_email %]
[% row.operating_system %]
[% row.os_version %]
[% row.compiler %]
[% row.compiler_version %]
[% row.arch %][% IF ! row.branches ; ' ' ; END -%] -
    - [%- - FOREACH branch_days IN row.branches.split(',') ; - branch_fields = branch_days.split(':'); - branch = branch_fields.0; - branch_day = branch_fields.1; - IF branch_day < 365 ; - %]
  • [% branch %] ([% branch_day %] days ago)
  • [% END; END %]
- -
-
-
-

-Hosting for the PostgreSQL Buildfarm is generously -provided by: -CommandPrompt, -The PostgreSQL Company -

-
- - - - - - - - - -