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 # enable-integer-datetimes is now the default
60 if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_3_STABLE')
62 $row->{buildflags} .- " --enable-integer-datetimes "
63 unless ($row->{build_flags} =~ /--(en|dis)able-integer-datetimes/);
65 $row->{build_flags} =~ s/--((enable|with)-)?//g;
66 $row->{build_flags} =~ s/libxml/xml/;
67 $row->{build_flags} =~ s/\S+=\S+//g;
68 push(@$statrows,$row);
76 my $template = new Template({});
78 print "Content-Type: text/html\n\n";
80 $template->process(\*DATA,{statrows=>$statrows});
86 [%- BLOCK img ; flag ; END -%]
87 [%- BLOCK imgx ; IF flag_imgs.$flag ; '<img src="' . flag_imgs{flag} . '" alt="' . flag . '" /> ' ; ELSE flag . ' ' ; END ; END -%]
94 perl = '/img/camel.png',
95 python = '/img/python.png',
96 debug = '/img/bug.png',
97 pam => '/img/pam.png',
98 cassert => '/img/cassert.png',
99 openssl => '/img/ssl_icon.gif',
100 nls => '/img/translateicon.gif',
101 krb5 => '/img/krb.gif',
102 tcl => '/img/tcl.png',
103 xml => '/img/xml.png',
104 'thread-safety' => '/img/threads.gif',
105 'integer-datetimes' = '/img/days.png',
108 [%- 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 %][%#
111 [%- BLOCK cl %] class=" [% SWITCH bgfor -%]
112 [%- CASE 'OK' %]pass[% CASE 'ContribCheck' %]warn[% CASE [ 'Check' 'InstallCheck' ] %]warnx[% CASE %]fail[% END %]"
114 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
115 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
116 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
118 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
119 <title>PostgreSQL BuildFarm Status</title>
120 <link rel="icon" type="image/png" href="/elephant-icon.png" />
121 <link rel="stylesheet" rev="stylesheet" href="/inc/pgbf.css" charset="utf-8" />
122 <style type="text/css"><!--
123 li#status a { color:rgb(17,45,137); background: url(/inc/b/r.png) no-repeat 100% -20px; }
124 li#status { background: url(/inc/b/l.png) no-repeat 0% -20px; }
130 <a href="/index.html"><img src="/inc/pgbuildfarm-banner.png" alt="PostgreSQL BuildFarm" width="800" height="73" /></a>
133 <li id="home"><a href="/index.html" title="PostgreSQL BuildFarm Home">Home</a></li>
134 <li id="status"><a href="/cgi-bin/show_status.pl" title="Current results">Status</a></li>
135 <li id="members"><a href="/cgi-bin/show_members.pl" title="Platforms tested">Members</a></li>
136 <li id="register"><a href="/register.html" title="Join PostgreSQL BuildFarm">Register</a></li>
137 <li id="pgfoundry"><a href="http://pgfoundry.org/projects/pgbuildfarm/">PGFoundry</a></li>
138 <li id="postgresql.org"><a href="http://www.postgresql.org">PostgreSQL.org</a></li>
141 </div><!-- banner -->
143 <h1>PostgreSQL BuildFarm Status</h1>
145 Shown here is the latest status of each farm member
146 for each branch it has reported on in the last 30 days.
149 Use the farm member link for history of that member
150 on the relevant branch.
152 <table><tr><th class="head" rowspan="2">Legend</th>
153 [% FOREACH flagset IN flag_imgs %]
154 <td><img src="[% flagset.value %]" title="[% flagset.key %]" alt="[% flagset.key %]" height="16" width="16" class="inline" align="center"/> = [% flagset.key %]</td>
155 [% IF loop.count == 6 %]</tr><tr>[% END %]
159 <table cellspacing="0">
161 [% FOREACH row IN statrows %]
162 [% IF row.branch != brch ; brch = row.branch %]
163 <tr><th class="head" colspan="4">Branch: [% brch %]</th></tr>
164 <tr><th>Alias</th><th>System</th><th>Status</th><th>Flags</th></tr>
166 <tr [% PROCESS cl bgfor=row.stage %]>
168 href="show_history.pl?nm=[% row.sysname %]&br=[% row.branch %]"
170 >[% row.sysname %]</a></td>
171 <td><span class="opsys">[% row.operating_system %]
172 [% row.os_version %]</span> <span class="compiler">
174 [% row.compiler_version %]</span> <span class="arch">
175 [%- row.architecture %]</span></td>
177 [%- row.when_ago | replace('\s',' ') %] ago
179 <a href="show_log.pl?nm=
180 [%- row.sysname %]&dt=
181 [%- row.snapshot | uri %]">
182 [%- IF row.stage != 'OK' %]Details[% ELSE %]Config[% END -%]</a></td>
184 <td class="flags">[% FOREACH flag IN row.build_flags.split().sort() ; PROCESS img ; END %]</td>
190 <p style="text-align: center;">
191 The PostgreSQL Buildfarm website is provided by:
192 <a href="http://www.commandprompt.com">CommandPrompt,
193 The PostgreSQL Company</a> <br />
194 The PostgreSQL community makes it work!
196 </div><!-- wrapper -->