Subversion Repositories camp_sysinfo_client_3

Rev

Rev 27 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27 Rev 31
Line 12... Line 12...
12
   use lib File::Spec->catdir($FindBin::Bin);
12
   use lib File::Spec->catdir($FindBin::Bin);
13
}
13
}
14
 
14
 
15
use sysinfoconf;
15
use sysinfoconf;
16
 
16
 
-
 
17
sub readManifest {
-
 
18
   my $filename = shift;
-
 
19
   my %manifest;
-
 
20
   my $directory = 'none';
-
 
21
   open FILE,"<$filename" or die "Could not read $filename: $!\n";
-
 
22
   while ( $line = <FILE> ) {
-
 
23
      chomp $line;
-
 
24
      next if $line =~ m/^#/;
-
 
25
      if ( $line =~ m/\[(.*)\]/ ) {
-
 
26
         $directory = $1;
-
 
27
      } else {
-
 
28
         my ( $filename, $flags ) = split( "\t", $line );
-
 
29
         $manifest{$filename}{'directory'} = $directory;
-
 
30
         $manifest{$filename}{$flags} = $flags;
-
 
31
      }
-
 
32
   }
-
 
33
   close FILE;
-
 
34
   return \%manifest;
-
 
35
}
-
 
36
 
-
 
37
sub installFile {
-
 
38
   my $fileSpec = shift;
-
 
39
   
-
 
40
 
-
 
41
my $manifest = &readManifest( 'MANIFEST' );
-
 
42
 
-
 
43
foreach my $filename ( keys %$manifest ) {
-
 
44
   if ( &installFile( $$manifest{$filename} ) ) {
-
 
45
      $$manifest{$filename}{'status'} = 'moved';
-
 
46
   } else {
-
 
47
      $$mainfest{$filename}{'status'} = 'error';
-
 
48
      print &dumpStatus( $manifest );
-
 
49
      die;
-
 
50
   }
-
 
51
}
-
 
52
      
-
 
53
}