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,{pg_expand_array => 0})
38 or die("$dsn,$dbuser,$dbpass,$!");
43 select timezone('GMT'::text, now())::timestamp(0) without time zone - b.snapshot AS when_ago, b.*
45 order by branch = 'HEAD' desc,
46 branch desc, $sort_clause
53 my $sth=$db->prepare($statement);
55 while (my $row = $sth->fetchrow_hashref)
57 next if (@members && ! grep {$_ eq $row->{sysname} } @members);
58 $row->{build_flags} =~ s/^\{(.*)\}$/$1/;
59 $row->{build_flags} =~ s/,/ /g;
60 # enable-integer-datetimes is now the default
61 if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_3_STABLE')
63 $row->{build_flags} .= " --enable-integer-datetimes "
64 unless ($row->{build_flags} =~ /--(en|dis)able-integer-datetimes/);
66 # enable-thread-safety is now the default
67 if ($row->{branch} eq 'HEAD' || $row->{branch} gt 'REL8_5_STABLE')
69 $row->{build_flags} .= " --enable-thread-safety "
70 unless ($row->{build_flags} =~ /--(en|dis)able-thread-safety/);
72 $row->{build_flags} =~ s/--((enable|with)-)?//g;
73 $row->{build_flags} =~ s/libxml/xml/;
74 $row->{build_flags} =~ s/\S+=\S+//g;
75 push(@$statrows,$row);
83 my $template_opts = { INCLUDE_PATH => $template_dir };
84 my $template = new Template($template_opts);
86 print "Content-Type: text/html\n\n";
88 $template->process('status.tt',
89 {statrows=>$statrows});