9 use vars qw($dbhost $dbname $dbuser $dbpass $dbport);
11 require "$ENV{BFConfDir}/BuildFarmWeb.pl";
13 my $dsn="dbi:Pg:dbname=$dbname";
14 $dsn .= ";host=$dbhost" if $dbhost;
15 $dsn .= ";port=$dbport" if $dbport;
17 my $dbh = DBI->connect($dsn,$dbuser,$dbpass) or die("$dsn,$dbuser,$dbpass,$!");
22 select sysname, max(snapshot) as snapshot
24 where branch = 'HEAD' and
25 log_stage = 'typedefs.log' and
26 snapshot > current_date::timestamp - interval '30 days'
29 my $builds = $dbh->selectall_arrayref($sql, { Slice => {} });
32 if ($query->param('show_list'))
34 print "Content-Type: text/html\n\n",
35 "<head><title>Typedefs URLs</title></head>\n",
36 "<body><h1>Typdefs URLs</h1>\n",
37 "<table border='1'><tr><th>member</th></tr>\n";
39 foreach my $build (@$builds)
41 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";
43 print "</table></body></html>\n";
52 and log_stage = 'typedefs.log'
56 my $sth = $dbh->prepare($sql);
58 foreach my $build (@$builds)
60 $sth->execute($build->{sysname},$build->{snapshot});
61 my @row = $sth->fetchrow;
62 my @typedefs = split(/\s+/,$row[0]);
63 @words{@typedefs} = 1 x @typedefs;
66 print "Content-Type: text/plain\n\n",
67 join("\n",sort keys %words),