--- doc/loncapafiles/removenolongerused.piml 2013/09/22 15:52:03 1.7 +++ doc/loncapafiles/removenolongerused.piml 2016/02/20 00:12:54 1.13 @@ -14,6 +14,7 @@ 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 = ( @@ -27,16 +28,19 @@ my %files = ( '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', + 'adm/jsMath'], ); my %multis = ( - rcgifs' => \@rcgifs, + 'rcgifs' => \@rcgifs, ); my @filestodelete = (); my @dirstodelete = (); @@ -46,7 +50,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); } } @@ -58,7 +62,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); } } @@ -88,7 +92,7 @@ if (@dirstodelete > 0) { chomp($choice); $choice =~ s/\s+//g; if ($choice eq 'Y') { - File::Path::remove_tree($dir); + File::Path::rmtree($dir); } } } @@ -117,7 +121,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); } }