Subversion Repositories camp_sysinfo_client_3

Rev

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

Rev 39 Rev 40
Line 282... Line 282...
282
         my ( $filename, $version, $checksum ) = split( "\t", $line );
282
         my ( $filename, $version, $checksum ) = split( "\t", $line );
283
         $$install{'files'}{$filename}{'new version'} = $version ? $version : '';
283
         $$install{'files'}{$filename}{'new version'} = $version ? $version : '';
284
      }
284
      }
285
      close FILE;
285
      close FILE;
286
   }
286
   }
-
 
287
   foreach my $file ( keys %{$$install{'files'}} ) {
-
 
288
      $$install{'files'}{$file}{'installed version'} = -2 unless defined $$install{'files'}{$file}{'installed version'};
-
 
289
      $$install{'files'}{$file}{'new version'} = -1 unless defined $$install{'files'}{$file}{'new version'};
-
 
290
   }
287
   return 1;
291
   return 1;
288
} # getVersions
292
} # getVersions
289
 
293
 
290
# this actually does the installation, except for the configuration
294
# this actually does the installation, except for the configuration
291
sub doInstall {
295
sub doInstall {
Line 293... Line 297...
293
   my $fileList = $$install{'files'};
297
   my $fileList = $$install{'files'};
294
   
298
   
295
   &checkDirectoryExists( $$install{'bindir'} . '/' );
299
   &checkDirectoryExists( $$install{'bindir'} . '/' );
296
   foreach my $file ( keys %$fileList ) {
300
   foreach my $file ( keys %$fileList ) {
297
      next unless ( $$fileList{$file}{'type'} && $$fileList{$file}{'type'} eq 'file' );
301
      next unless ( $$fileList{$file}{'type'} && $$fileList{$file}{'type'} eq 'file' );
298
      next if $$install{'action'} eq 'upgrade' &&
302
      next if $$install{'action'} eq 'upgrade' && ! defined( $$fileList{$file}{'installed version'} )
299
              $$fileList{$file}{'installed version'} &&
303
              ||
300
              $$fileList{$file}{'new version'} eq $$fileList{$file}{'installed version'};
304
              ( $$fileList{$file}{'new version'} eq $$fileList{$file}{'installed version'} );
301
      &checkDirectoryExists( $$fileList{$file}{'target'} );
305
      &checkDirectoryExists( $$fileList{$file}{'target'} );
302
      &runCommand( 
306
      &runCommand( 
303
            "cp $$fileList{$file}{'source'} $$fileList{$file}{'target'}",
307
            "cp $$fileList{$file}{'source'} $$fileList{$file}{'target'}",
304
            "chmod $$fileList{$file}{'permission'} $$fileList{$file}{'target'}",
308
            "chmod $$fileList{$file}{'permission'} $$fileList{$file}{'target'}",
305
            "chown  $$fileList{$file}{'owner'} $$fileList{$file}{'target'}"
309
            "chown  $$fileList{$file}{'owner'} $$fileList{$file}{'target'}"
Line 418... Line 422...
418
   print "Done, you should check the files in $install{'bindir'} and $install{'confdir'} before running\n";
422
   print "Done, you should check the files in $install{'bindir'} and $install{'confdir'} before running\n";
419
   print "If you need help configuring, the helper app at\n$install{'configuration'}{'configurator'}\ncan be used.\n";
423
   print "If you need help configuring, the helper app at\n$install{'configuration'}{'configurator'}\ncan be used.\n";
420
}
424
}
421
 
425
 
422
1;   
426
1;   
-
 
427
 
-
 
428
 
-
 
429
# add uninstall, clean to install.pl
-
 
430
# clean will look for any file in bindir which is NOT in the list of available files and remove them
-
 
431
# if files already exist in install, preserve their permissions