5 Copyright (c) 2003-2010, Andrew Dunstan
7 See accompanying License file for license details
17 use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
19 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
21 my $dsn="dbi:Pg:dbname=$dbname";
22 $dsn .= ";host=$dbhost" if $dbhost;
23 $dsn .= ";port=$dbport" if $dbport;
25 my $dbh = DBI->connect($dsn,$dbuser,$dbpass) or die("$dsn,$dbuser,$dbpass,$!");
30 select sysname, max(snapshot) as snapshot
32 where branch = 'HEAD' and
33 log_stage = 'typedefs.log' and
34 snapshot > current_date::timestamp - interval '30 days'
37 my $builds = $dbh->selectall_arrayref($sql, { Slice => {} });
40 if ($query->param('show_list'))
42 print "Content-Type: text/html\n\n",
43 "<head><title>Typedefs URLs</title></head>\n",
44 "<body><h1>Typdefs URLs</h1>\n",
45 "<table border='1'><tr><th>member</th></tr>\n";
47 foreach my $build (@$builds)
49 print "<tr><td><a href='http://www.pgbuildfarm.org/cgi-bin/show_stage_log.pl?nm=$build->{sysname}\&dt=$build->{snapshot}\&stg=typedefs'>$build->{sysname}</a></td></tr>\n";
51 print "</table></body></html>\n";
60 and log_stage = 'typedefs.log'
64 my $sth = $dbh->prepare($sql);
66 foreach my $build (@$builds)
68 $sth->execute($build->{sysname},$build->{snapshot});
69 my @row = $sth->fetchrow;
70 my @typedefs = split(/\s+/,$row[0]);
71 @words{@typedefs} = 1 x @typedefs;
74 print "Content-Type: text/plain\n\n",
75 join("\n",sort keys %words),