Diff for /doc/loncapafiles/removenolongerused.piml between versions 1.2 and 1.10

version 1.2, 2013/08/09 06:24:21 version 1.10, 2014/06/20 19:23:03
Line 14  my %paths = ( Line 14  my %paths = (
               'apache'     => '/home/httpd/lib/perl/Apache',                'apache'     => '/home/httpd/lib/perl/Apache',
               'londocroot' => '/home/httpd/html',                'londocroot' => '/home/httpd/html',
               'rcgifs'     => '/home/httpd/html/res/adm/pages',                'rcgifs'     => '/home/httpd/html/res/adm/pages',
                 'debug'      => '/home/httpd/perl/debug',
             );              );
     
 my %files = (  my %files = (
               'londaemons' => ['lonManage','lchtmldir','lonhttpd'],                'londaemons' => ['lonManage','lchtmldir','lonhttpd','lcuseradd','lonc'],
               'apache'     => ['londropadd.pm','lonconstruct.pm',                'apache'     => ['londropadd.pm','lonconstruct.pm',
                                'lonremote.pm','admbookmarks.pm'],                                 'lonremote.pm','admbookmarks.pm','lonassignments.pm'],
               'londocroot' => ['adm/rat/extpickcode.html',                'londocroot' => ['adm/rat/extpickcode.html',
                                'adm/rat/extpickframe.html',                                 'adm/rat/extpickframe.html',
                                'res/adm/pages/imgmaps.html',                                 'res/adm/pages/imgmaps.html',
                                'res/adm/pages/menu.html',                                 'res/adm/pages/menu.html',
                                'res/adm/pages/homeworkmenu.html'],                                 'res/adm/pages/homeworkmenu.html',
                                  'adm/help/gif/vbkm.gif',
                                  'adm/help/eps/vbkm.eps'],
                 'debug'      => ['archive_coursedata_tables.pl'],
             );              );
   
 my %dirs = (  my %dirs = (
               'londocroot' => 'adm/lonLCDfont',                'londocroot' => ['adm/lonLCDfont',
                               'htmlarea',                                    'htmlarea',
                               'res/adm/pages/bookmarkmenu',                                    'res/adm/pages/bookmarkmenu'],
            );             );
   
 my %multis = (  my %multis = (
                  rcgifs'     => \@rcgifs,                  'rcgifs'     => \@rcgifs,
              );                ); 
 my @filestodelete = ();  my @filestodelete = ();
 my @dirstodelete = ();  my @dirstodelete = ();
Line 44  foreach my $key (sort(keys(%files))) { Line 48  foreach my $key (sort(keys(%files))) {
     if ($paths{$key} ne '') {      if ($paths{$key} ne '') {
         if (ref($files{$key}) eq 'ARRAY') {          if (ref($files{$key}) eq 'ARRAY') {
             foreach my $file (@{$files{$key}}) {              foreach my $file (@{$files{$key}}) {
                 if (-f $paths{$key}.'/'.$file) {                  if (($file ne '') && (-f $paths{$key}.'/'.$file)) {
                     push(@filestodelete,$paths{$key}.'/'.$file);                      push(@filestodelete,$paths{$key}.'/'.$file);
                 }                  }
             }              }
Line 56  foreach my $key (sort(keys(%dirs))) { Line 60  foreach my $key (sort(keys(%dirs))) {
     if ($paths{$key} ne '') {      if ($paths{$key} ne '') {
         if (ref($dirs{$key}) eq 'ARRAY') {          if (ref($dirs{$key}) eq 'ARRAY') {
             foreach my $dir (@{$dirs{$key}}) {              foreach my $dir (@{$dirs{$key}}) {
                 if (-d $paths{$key}.'/'.$dir) {                  if (($dir ne '') && (-d $paths{$key}.'/'.$dir)) {
                     push(@dirstodelete,$paths{$key}.'/'.$dir);                      push(@dirstodelete,$paths{$key}.'/'.$dir);
                 }                  }
             }              }
Line 84  if (@dirstodelete > 0) { Line 88  if (@dirstodelete > 0) {
         print "$dir  -- delete? Enter: Y or N:\n";          print "$dir  -- delete? Enter: Y or N:\n";
         my $choice=<>;          my $choice=<>;
         chomp($choice);          chomp($choice);
         $choice =~ s/\s+//g;           $choice =~ s/\s+//g;
         if ($choice eq 'Y') {          if ($choice eq 'Y') {
             File::Path::remove_tree($dir);              File::Path::remove_tree($dir);
         }          }
Line 115  if (@multistodelete > 0) { Line 119  if (@multistodelete > 0) {
     $choice =~ s/\s+//g;      $choice =~ s/\s+//g;
     if ($choice eq 'Y') {      if ($choice eq 'Y') {
         foreach my $item (@multistodelete) {          foreach my $item (@multistodelete) {
             next if ((($item =~/\*/) || ($item eq '') || ($item eq '/'));              next if (($item =~/\*/) || ($item eq '') || ($item eq '/'));
             unlink($item);              unlink($item);
         }          }
     }      }

Removed from v.1.2  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>