display sysnotes
[buildfarm-server.git] / cgi-bin / show_members.pl
index 2b6e0be40d7cac8e04c305d7a3f6e0c16e9f4544..3bc733c5a2127300094dffa4970b25679125b2f8 100755 (executable)
@@ -31,22 +31,27 @@ my $db = DBI->connect($dsn,$dbuser,$dbpass);
 # there is possibly some redundancy in this query, but it makes
 # a lot of the processing simpler.
 
-my $statement = <<EOS;
+my $statement = q{
 
   select name, operating_system, os_version, compiler, compiler_version, owner_email, 
+    sys_notes_ts::date AS sys_notes_date, sys_notes,
     architecture as arch, ARRAY(
                                select branch || ':' || 
-                                      extract(days from now() - latest_snapshot)
-                               from build_status_latest l 
+                                      extract(days from now() - l.snapshot)
+                               from latest_snapshot l 
                                where l.sysname = s.name
                                order by branch <> 'HEAD', branch desc 
-                               ) as branches 
+                               ) as branches, 
+                         ARRAY(select compiler_version || '\t' ||  os_version || '\t' || effective_date
+                               from personality p
+                               where p.name = s.name 
+                               order by effective_date
+                               ) as personalities
   from buildsystems s
   where status = 'approved'
-  order by $sort_by
+};
 
-EOS
-;
+$statement .= "order by $sort_by";
 
 my $statrows=[];
 my $sth=$db->prepare($statement);
@@ -54,6 +59,21 @@ $sth->execute;
 while (my $row = $sth->fetchrow_hashref)
 {
     $row->{branches} =~ s/^\{(.*)\}$/$1/;
+    my $personalities = $row->{personalities};
+    $personalities =~ s/^\{(.*)\}$/$1/;
+    my @personalities = split(',',$personalities);
+    $row->{personalities} = [];
+    foreach my $personality (@personalities)
+    {
+       $personality =~ s/^"(.*)"$/$1/;
+       $personality =~ s/\\(.)/$1/g;
+       
+       my ($compiler_version, $os_version, $effective_date) = split(/\t/,$personality);
+       $effective_date =~ s/ .*//;
+       push(@{$row->{personalities}}, {compiler_version => $compiler_version, 
+                                       os_version => $os_version, 
+                                       effective_date => $effective_date });
+    }
     $row->{owner_email} =~ s/\@/ [ a t ] /;
     push(@$statrows,$row);
 }