--- doc/loncapafiles/removenolongerused.piml 2013/09/22 18:31:55 1.1.2.6 +++ doc/loncapafiles/removenolongerused.piml 2016/08/05 14:37:53 1.1.2.9 @@ -11,6 +11,7 @@ my %paths = ( 'londaemons' => '/home/httpd/perl', 'apache' => '/home/httpd/lib/perl/Apache', 'londocroot' => '/home/httpd/html', + 'debug' => '/home/httpd/perl/debug', ); my %files = ( @@ -21,11 +22,14 @@ my %files = ( 'adm/rat/extpickframe.html', 'adm/help/gif/vbkm.gif', 'adm/help/eps/vbkm.eps'], + 'debug' => ['archive_coursedata_tables.pl'], ); my %dirs = ( - 'londocroot' => 'htmlarea', - 'res/adm/pages/bookmarkmenu', + 'londocroot' => ['htmlarea', + 'res/adm/pages/bookmarkmenu', + 'res/adm/pages/reactionresponse', + adm/jsMath'], ); my @filestodelete = (); @@ -34,7 +38,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); } } @@ -46,7 +50,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); } } @@ -63,7 +67,7 @@ if (@dirstodelete > 0) { chomp($choice); $choice =~ s/\s+//g; if ($choice eq 'Y') { - File::Path::remove_tree($dir); + File::Path::rmtree($dir); } } }