/[mdap]/lib/MDAP/Commands.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/MDAP/Commands.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 57 by dpavlin, Fri Nov 16 18:06:27 2007 UTC revision 58 by dpavlin, Fri Nov 16 19:12:08 2007 UTC
# Line 4  use strict; Line 4  use strict;
4  use warnings;  use warnings;
5    
6  use Module::Pluggable;  use Module::Pluggable;
7  use Data::Dump qw/dump/;  use MDAP;
   
 my $debug = 0;  
 my $verbose = 1;  
8    
9  my $commands = [  my $commands = [
10  'service system modify name=MDAP log=enabled',  'service system modify name=MDAP log=enabled',
# Line 20  my $ant_command; Line 17  my $ant_command;
17    
18  sub check {  sub check {
19          my ( $self, $h ) = @_;          my ( $self, $h ) = @_;
         warn "## ",__PACKAGE__,"check(",dump($h),")" if $debug;  
20    
21          my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?";          my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?";
22    
23          foreach my $command ( @$commands ) {          foreach my $command ( @$commands ) {
24                  next if $ant_command->{$serial}->{$command}++;                  next if $ant_command->{$serial}->{$command}++;
   
                 warn "## sending command $command to $serial ",  
                         $h->{'_VARIANT_FRIENDLY_NAME'}, " ",  
                         $h->{'_BOARD_NAME'}, " ",  
                         $h->{'_BUILD'},  
                         "\n" if $verbose;  
   
25                  return $command;                  return $command;
26          }          }
27    
28          warn "OK ",__PACKAGE__," $serial all commands sent\n" if $verbose;          once "OK ",__PACKAGE__," $serial all commands sent";
29          return;          return;
30  }  }
31    

Legend:
Removed from v.57  
changed lines
  Added in v.58

  ViewVC Help
Powered by ViewVC 1.1.26