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 vpath => '/img/vpath.png',
110 xml => '/img/xml.png',
111 'thread-safety' => '/img/threads.gif',
112 'integer-datetimes' = '/img/days.png',
115 [%- 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 %][%#
118 [%- BLOCK cl %] class="[% SWITCH bgfor.replace('-.*','') -%]
119 [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
121 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
122 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
123 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
125 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
126 <title>PostgreSQL BuildFarm Status</title>
127 <link rel="icon" type="image/png" href="/elephant-icon.png" />
128 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
129 <style type="text/css"><!--
130 li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; }
131 li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
137 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
140 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
141 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
142 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
143 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
144 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
145 <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
148 </div><!-- banner -->
150 <h1>PostgreSQL BuildFarm Status</h1>
152 Shown here is the latest status of each farm member
153 for each branch it has reported on in the last 30 days.
156 Use the farm member link for history of that member
157 on the relevant branch.
159 <table><tr><th class="head" rowspan="2">Legend</th>
160 [% FOREACH flagset IN flag_imgs %]
161 <td><img src="[% flagset.value %]" title="[% flagset.key %]" alt="[% flagset.key %]" height="16" width="16" class="inline" align="center"/> = [% flagset.key %]</td>
162 [% IF loop.count == 6 %]</tr><tr>[% END %]
166 <table cellspacing="0">
168 [% FOREACH row IN statrows %]
169 [% IF row.branch != brch ; brch = row.branch %]
170 <tr><th class="head" colspan="4">Branch: [% brch %]</th></tr>
171 <tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
173 <tr [% PROCESS cl bgfor=row.stage %]>
175 href="show_history.pl?nm=[% row.sysname %]&br=[% row.branch %]"
177 >[% row.sysname %]</a></td>
178 <td><span class="opsys">[% row.operating_system %]
179 [% row.os_version %]</span> <span class="compiler">
181 [% row.compiler_version %]</span> <span class="arch">
182 [%- row.architecture %]</span></td>
184 [%- row.when_ago | replace('\s',' ') %] ago
186 <a href="show_log.pl?nm=
187 [%- row.sysname %]&dt=
188 [%- row.snapshot | uri %]">
189 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
191 <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
197 <p style="text-align: center;">
198 The PostgreSQL Buildfarm website is provided by:
199 <a href="http://www.commandprompt.com">CommandPrompt,
200 The PostgreSQL Company</a> <br />
201 The PostgreSQL community makes it work!
203 </div><!-- wrapper -->