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,$!");
42 select timezone('GMT'::text, now())::timestamp(0) without time zone - b.snapshot AS when_ago, b.*
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 # enable-integer-datetimes is now the default
60 if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_3_STABLE')
62 $row->{build_flags} .= " --enable-integer-datetimes "
63 unless ($row->{build_flags} =~ /--(en|dis)able-integer-datetimes/);
65 # enable-thread-safety is now the default
66 if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_5_STABLE')
68 $row->{build_flags} .= " --enable-thread-safety "
69 unless ($row->{build_flags} =~ /--(en|dis)able-thread-safety/);
71 $row->{build_flags} =~ s/--((enable|with)-)?//g;
72 $row->{build_flags} =~ s/libxml/xml/;
73 $row->{build_flags} =~ s/\S+=\S+//g;
74 push(@$statrows,$row);
82 my $template = new Template({});
84 print "Content-Type: text/html\n\n";
86 $template->process(\*DATA,{statrows=>$statrows});
92 [%- BLOCK img ; flag ; END -%]
93 [%- BLOCK imgx ; IF flag_imgs.$flag ; '<img src="' . flag_imgs{flag} . '" alt="' . flag . '" /> ' ; ELSE flag . ' ' ; END ; END -%]
100 perl = '/img/camel.png',
101 python = '/img/python.png',
102 debug = '/img/bug.png',
103 pam => '/img/pam.png',
104 cassert => '/img/cassert.png',
105 openssl => '/img/ssl_icon.gif',
106 nls => '/img/translateicon.gif',
107 krb5 => '/img/krb.gif',
108 tcl => '/img/tcl.png',
109 xml => '/img/xml.png',
110 'thread-safety' => '/img/threads.gif',
111 'integer-datetimes' = '/img/days.png',
114 [%- 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 %][%#
117 [%- BLOCK cl %] class="[% SWITCH bgfor.replace('-.*','') -%]
118 [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
120 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
121 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
122 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
124 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
125 <title>PostgreSQL BuildFarm Status</title>
126 <link rel="icon" type="image/png" href="/elephant-icon.png" />
127 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
128 <style type="text/css"><!--
129 li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; }
130 li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
136 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
139 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
140 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
141 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
142 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
143 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
144 <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
147 </div><!-- banner -->
149 <h1>PostgreSQL BuildFarm Status</h1>
151 Shown here is the latest status of each farm member
152 for each branch it has reported on in the last 30 days.
155 Use the farm member link for history of that member
156 on the relevant branch.
158 <table><tr><th class="head" rowspan="2">Legend</th>
159 [% FOREACH flagset IN flag_imgs %]
160 <td><img src="[% flagset.value %]" title="[% flagset.key %]" alt="[% flagset.key %]" height="16" width="16" class="inline" align="center"/> = [% flagset.key %]</td>
161 [% IF loop.count == 6 %]</tr><tr>[% END %]
165 <table cellspacing="0">
167 [% FOREACH row IN statrows %]
168 [% IF row.branch != brch ; brch = row.branch %]
169 <tr><th class="head" colspan="4">Branch: [% brch %]</th></tr>
170 <tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
172 <tr [% PROCESS cl bgfor=row.stage %]>
174 href="show_history.pl?nm=[% row.sysname %]&br=[% row.branch %]"
176 >[% row.sysname %]</a></td>
177 <td><span class="opsys">[% row.operating_system %]
178 [% row.os_version %]</span> <span class="compiler">
180 [% row.compiler_version %]</span> <span class="arch">
181 [%- row.architecture %]</span></td>
183 [%- row.when_ago | replace('\s',' ') %] ago
185 <a href="show_log.pl?nm=
186 [%- row.sysname %]&dt=
187 [%- row.snapshot | uri %]">
188 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
190 <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
196 <p style="text-align: center;">
197 The PostgreSQL Buildfarm website is provided by:
198 <a href="http://www.commandprompt.com">CommandPrompt,
199 The PostgreSQL Company</a> <br />
200 The PostgreSQL community makes it work!
202 </div><!-- wrapper -->