use upgraded personalities consistently on all pages
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 13 Oct 2010 18:46:04 +0000 (18:46 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Wed, 13 Oct 2010 18:46:04 +0000 (18:46 +0000)
cgi-bin/show_history.pl
cgi-bin/show_log.pl
cgi-bin/show_members.pl
templates/members.tt

index f1fa13cd6f8134f7af9ca4d4298a37c1375740bb..902fdb5b58a46821ab4feee3d441ff6b6a86361e 100755 (executable)
@@ -28,6 +28,13 @@ my $branch = $query->param('br'); $branch =~ s/[^a-zA-Z0-9_ -]//g;
 my $hm = $query->param('hm');  $hm =~ s/[^a-zA-Z0-9_ -]//g;
 $hm = '240' unless $hm =~ /^\d+$/;
 
+my $latest_personality = $db->selectrow_arrayref(q{
+            select os_version, compiler_version
+            from personality
+            where name = ?
+            order by effective_date desc limit 1
+       }, undef, $member);
+
 # we don't really need to do this join, since we only want
 # one row from buildsystems. but it means we only have to run one
 # query. If it gets heavy we'll split it up and run two
@@ -56,8 +63,14 @@ $sth->execute($member,$branch);
 while (my $row = $sth->fetchrow_hashref)
 {
     $row->{owner_email} =~ s/\@/ [ a t ] /;
-       push(@$statrows,$row);
+    if ($latest_personality)
+    {
+       $row->{os_version} = $latest_personality->[0];
+       $row->{compiler_version} = $latest_personality->[1];
+    }
+    push(@$statrows,$row);
 }
+
 $sth->finish;
 
 $db->disconnect;
index b462cc7f4cf993719976397526bc1a4163f187fe..663fc26aa9e0efab0132641b0fecb0b13ca813c3 100755 (executable)
@@ -79,7 +79,20 @@ if ($system && $logdate)
        $sth=$db->prepare($statement);
        $sth->execute($system);
        $info_row=$sth->fetchrow_hashref;
+
+       my $latest_personality = $db->selectrow_arrayref(q{
+           select os_version, compiler_version
+           from personality
+           where effective_date < ?
+           and name = ?
+           order by effective_date desc limit 1
+       }, undef, $logdate, $system);
         # $sysinfo = join(" ",@$row);
+       if ($latest_personality)
+       {
+           $info_row->{os_version} = $latest_personality->[0];
+           $info_row->{compiler_version} = $latest_personality->[1];
+       }
        $sth->finish;
        $db->disconnect;
 }
index 58039d558ac3565ce8eff274bfbbf5024aaf79d7..5d4a0c97623a417043b7e0bfc3c63827ee1a806f 100755 (executable)
@@ -60,13 +60,15 @@ while (my $row = $sth->fetchrow_hashref)
     $row->{branches} =~ s/^\{(.*)\}$/$1/;
     my $personalities = $row->{personalities};
     $personalities =~ s/^\{(.*)\}$/$1/;
-    my @personalities = split($personalities,',');
+    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 });
index 18bb907a9b0750e57202bfa19255c075c80ad579..cb183114a3b64a31caa0c73109e8df7003e7023a 100644 (file)
     [% alt = ! alt %]
     <td><input type="checkbox" name="member" value="[% row.name %]" /></td>
     <td>[% row.name %]<br />[% row.owner_email %]</td>
-    <td>[% row.operating_system %]<br />[% row.os_version %]</td>
-    <td>[% row.compiler %]<br />[% row.compiler_version %]</td>
+    <td>[% row.operating_system %]<br />[% row.os_version %]
+       [% FOREACH personality IN row.personalities %]
+        <br / > w.e.f. [% personality.effective_date %]: [% personality.os_version %]
+        [% END %]
+    </td>
+    <td>[% row.compiler %]<br />[% row.compiler_version %]
+       [% FOREACH personality IN row.personalities %]
+        <br / > w.e.f. [% personality.effective_date %]: [% personality.compiler_version %]
+        [% END %]
+    </td>
     <td>[% row.arch %]</td>
     <td class="branch">[% IF ! row.branches ; '&nbsp;' ; END -%]
     <ul>