--- doc/loncapafiles/removenolongerused.piml 2013/08/09 06:24:21 1.2 +++ doc/loncapafiles/removenolongerused.piml 2015/09/21 14:24:34 1.12 @@ -14,27 +14,32 @@ my %paths = ( 'apache' => '/home/httpd/lib/perl/Apache', 'londocroot' => '/home/httpd/html', 'rcgifs' => '/home/httpd/html/res/adm/pages', + 'debug' => '/home/httpd/perl/debug', ); my %files = ( - 'londaemons' => ['lonManage','lchtmldir','lonhttpd'], + 'londaemons' => ['lonManage','lchtmldir','lonhttpd','lcuseradd','lonc'], 'apache' => ['londropadd.pm','lonconstruct.pm', - 'lonremote.pm','admbookmarks.pm'], + 'lonremote.pm','admbookmarks.pm','lonassignments.pm'], 'londocroot' => ['adm/rat/extpickcode.html', 'adm/rat/extpickframe.html', 'res/adm/pages/imgmaps.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 = ( - 'londocroot' => 'adm/lonLCDfont', - 'htmlarea', - 'res/adm/pages/bookmarkmenu', + 'londocroot' => ['adm/lonLCDfont', + 'htmlarea', + 'res/adm/pages/bookmarkmenu', + 'res/adm/pages/reactionresponse'], ); my %multis = ( - rcgifs' => \@rcgifs, + 'rcgifs' => \@rcgifs, ); my @filestodelete = (); my @dirstodelete = (); @@ -44,7 +49,7 @@ foreach my $key (sort(keys(%files))) { if ($paths{$key} ne '') { if (ref($files{$key}) eq 'ARRAY') { foreach my $file (@{$files{$key}}) { - if (-f $paths{$key}.'/'.$file) { + if (($file ne '') && (-f $paths{$key}.'/'.$file)) { push(@filestodelete,$paths{$key}.'/'.$file); } } @@ -56,7 +61,7 @@ foreach my $key (sort(keys(%dirs))) { if ($paths{$key} ne '') { if (ref($dirs{$key}) eq 'ARRAY') { foreach my $dir (@{$dirs{$key}}) { - if (-d $paths{$key}.'/'.$dir) { + if (($dir ne '') && (-d $paths{$key}.'/'.$dir)) { push(@dirstodelete,$paths{$key}.'/'.$dir); } } @@ -84,9 +89,9 @@ if (@dirstodelete > 0) { print "$dir -- delete? Enter: Y or N:\n"; my $choice=<>; chomp($choice); - $choice =~ s/\s+//g; + $choice =~ s/\s+//g; if ($choice eq 'Y') { - File::Path::remove_tree($dir); + File::Path::rmtree($dir); } } } @@ -115,7 +120,7 @@ if (@multistodelete > 0) { $choice =~ s/\s+//g; if ($choice eq 'Y') { foreach my $item (@multistodelete) { - next if ((($item =~/\*/) || ($item eq '') || ($item eq '/')); + next if (($item =~/\*/) || ($item eq '') || ($item eq '/')); unlink($item); } }