record latest status date for member
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 11 Oct 2010 17:17:45 +0000 (17:17 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Mon, 11 Oct 2010 17:17:45 +0000 (17:17 +0000)
cgi-bin/pgstatus.pl

index 5896761f0d8953fec98d15b78ef5934c9cc1032b..c1c338dbf45f1b17761820cd489159b25947cbd3 100755 (executable)
@@ -331,6 +331,32 @@ $row=$sth->fetchrow_arrayref;
 my ($os, $compiler,$arch) = @$row;
 $sth->finish;
 
+$db->begin_work;
+my $have_status = $db->selectrow_arrayref( q{
+    select 1 
+    from build_status_latest 
+    where sysname = ? and branch = ?
+}, 
+                                          undef, $animal, $branch);
+if ($have_status) 
+{
+    $db->do(q{
+             update build_status_latest
+                 set latest_snapshot = ?
+                 where sysname = ? and branch = ?
+             },
+           undef, $dbdate, $animal, $branch);
+}
+else
+{
+    $db->do(q{
+             insert into build_status_latest
+                 (sysname, brancn, latest_snapshot)
+             values (?,?,?)
+             },
+           undef, $dbdate, $animal, $branch);
+}
+$db->commit;
 
 $db->begin_work;
 $db->do("delete from dashboard_mat");