8 use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
11 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
14 my @members = $query->param('member');
15 map { s/[^a-zA-Z0-9_ -]//g; } @members;
17 my $dsn="dbi:Pg:dbname=$dbname";
18 $dsn .= ";host=$dbhost" if $dbhost;
19 $dsn .= ";port=$dbport" if $dbport;
23 my $sortby = $query->param('sortby') || 'nosort';
24 if ($sortby eq 'name')
26 $sort_clause = 'lower(sysname),';
28 elsif ($sortby eq 'os')
30 $sort_clause = 'lower(operating_system), os_version desc,';
32 elsif ($sortby eq 'compiler')
34 $sort_clause = "lower(compiler), compiler_version,";
37 my $db = DBI->connect($dsn,$dbuser,$dbpass) or die("$dsn,$dbuser,$dbpass,$!");
44 order by branch = 'HEAD' desc,
45 branch desc, $sort_clause
52 my $sth=$db->prepare($statement);
54 while (my $row = $sth->fetchrow_hashref)
56 next if (@members && ! grep {$_ eq $row->{sysname} } @members);
57 $row->{build_flags} =~ s/^\{(.*)\}$/$1/;
58 $row->{build_flags} =~ s/,/ /g;
59 $row->{build_flags} =~ s/--((enable|with)-)?//g;
60 $row->{build_flags} =~ s/libxml/xml/;
61 $row->{build_flags} =~ s/\S+=\S+//g;
62 push(@$statrows,$row);
70 my $template = new Template({});
72 print "Content-Type: text/html\n\n";
74 $template->process(\*DATA,{statrows=>$statrows});
80 [%- BLOCK img ; flag ; END -%]
81 [%- BLOCK imgx ; IF flag_imgs.$flag ; '<img src="' . flag_imgs{flag} . '" alt="' . flag . '" /> ' ; ELSE flag . ' ' ; END ; END -%]
88 perl = '/img/camel.png',
89 python = '/img/python.png',
90 debug = '/img/bug.png',
91 pam => '/img/pam.png',
92 cassert => '/img/cassert.png',
93 openssl => '/img/ssl_icon.gif',
94 nls => '/img/translateicon.gif',
95 krb5 => '/img/krb.gif',
96 tcl => '/img/tcl.png',
97 xml => '/img/xml.png',
98 'thread-safety' => '/img/threads.gif',
99 'integer-datetimes' = '/img/days.png',
102 [%- BLOCK img ; IF flag == 'depend' or flag == 'gnu-ld' ; ; ELSIF flag_imgs.$flag %]<img src="[% flag_imgs.$flag %]" title="[% flag %]" alt="[% flag %]" height="16" width="16" class="inline" align="bottom" /> [% ELSE %][%#
105 [%- BLOCK cl %] class=" [% SWITCH bgfor -%]
106 [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
108 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
109 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
110 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
112 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
113 <title>PostgreSQL BuildFarm Status</title>
114 <link rel="icon" type="image/png" href="/elephant-icon.png" />
115 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
116 <style type="text/css"><!--
117 li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; }
118 li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
124 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
127 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
128 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
129 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
130 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
131 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
132 <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
135 </div><!-- banner -->
137 <h1>PostgreSQL BuildFarm Status</h1>
139 Shown here is the latest status of each farm member
140 for each branch it has reported on in the last 30 days.
143 Use the farm member link for history of that member
144 on the relevant branch.
146 <table><tr><th class="head" rowspan="2">Legend</th>
147 [% FOREACH flagset IN flag_imgs %]
148 <td><img src="[% flagset.value %]" title="[% flagset.key %]" alt="[% flagset.key %]" height="16" width="16" class="inline" align="center"/> = [% flagset.key %]</td>
149 [% IF loop.count == 6 %]</tr><tr>[% END %]
153 <table cellspacing="0">
155 [% FOREACH row IN statrows %]
156 [% IF row.branch != brch ; brch = row.branch %]
157 <tr><th class="head" colspan="4">Branch: [% brch %]</th></tr>
158 <tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
160 <tr [% PROCESS cl bgfor=row.stage %]>
162 href="show_history.pl?nm=[% row.sysname %]&br=[% row.branch %]"
164 >[% row.sysname %]</a></td>
165 <td><span class="opsys">[% row.operating_system %]
166 [% row.os_version %]</span> <span class="compiler">
168 [% row.compiler_version %]</span> <span class="arch">
169 [%- row.architecture %]</span></td>
171 [%- row.when_ago | replace('\s',' ') %] ago
173 <a href="show_log.pl?nm=
174 [%- row.sysname %]&dt=
175 [%- row.snapshot | uri %]">
176 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
178 <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
184 <p style="text-align: center;">
185 The PostgreSQL Buildfarm website is provided by:
186 <a href="http://www.commandprompt.com">CommandPrompt,
187 The PostgreSQL Company</a> <br />
188 The PostgreSQL community makes it work!
190 </div><!-- wrapper -->