8 use vars qw($dbhost $dbname $dbuser $dbpass $dbport $template_dir);
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_opts = { INCLUDE_PATH => $template_dir };
83 my $template = new Template($template_opts);
85 print "Content-Type: text/html\n\n";
87 $template->process('status.tt',
88 {statrows=>$statrows});