[Midnightbsd-cvs] mports: magus.pl: note events differently.

ctriv at midnightbsd.org ctriv at midnightbsd.org
Fri Mar 14 14:48:21 EDT 2008


Log Message:
-----------
note events differently.  this should give timestamps and machine links.

Modified Files:
--------------
    mports/Tools/magus/slave:
        magus.pl (r1.17 -> r1.18)

-------------- next part --------------
Index: magus.pl
===================================================================
RCS file: /home/cvs/mports/Tools/magus/slave/magus.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -L Tools/magus/slave/magus.pl -L Tools/magus/slave/magus.pl -u -r1.17 -r1.18
--- Tools/magus/slave/magus.pl
+++ Tools/magus/slave/magus.pl
@@ -142,6 +142,8 @@
   #
   my ($port, $chroot);
 
+  $port->note_event(info => "Test started.");
+
   eval {
     $port = $lock->port;
     $chroot = Magus::Chroot->new(tarball => $Magus::Config{ChrootTarBall});
@@ -206,6 +208,8 @@
   } else {
     die "Child exited unexpectantly: $?\n";
   }
+  
+  $port->note_event($port->status => "Test complete.");
 }
 
 
@@ -288,6 +292,8 @@
 
 =cut  
 
+
+
 sub insert_results {
   my ($port, $results) = @_;
 
@@ -296,12 +302,13 @@
   $port->status($results->{'summary'});
   $port->update;  
   
+  my %type_conversion = (skip => 'skip', warning => 'warn', error => 'fail');
+  
   foreach my $type (qw(skip warning error)) {
     next unless $results->{$type . 's'};
     
     foreach my $sr (@{$results->{$type . 's'}}) {
-      $sr->{type} = $type;
-      $port->add_to_events($sr);
+      $port->note_event($type_conversion{$type} => $sr->{msg});
     }
   }  
   


More information about the Midnightbsd-cvs mailing list