--- doc/loncapafiles/removenolongerused.piml 2013/08/10 03:13:01 1.1.2.3 +++ doc/loncapafiles/removenolongerused.piml 2016/08/05 14:37:53 1.1.2.9 @@ -11,19 +11,25 @@ my %paths = ( 'londaemons' => '/home/httpd/perl', 'apache' => '/home/httpd/lib/perl/Apache', 'londocroot' => '/home/httpd/html', + 'debug' => '/home/httpd/perl/debug', ); my %files = ( - 'londaemons' => ['lonManage','lchtmldir','lonhttpd','lcuseradd'], + 'londaemons' => ['lonManage','lchtmldir','lonhttpd','lcuseradd','lonc'], 'apache' => ['londropadd.pm','lonconstruct.pm', - 'admbookmarks.pm'], + 'admbookmarks.pm','lonassignments.pm'], 'londocroot' => ['adm/rat/extpickcode.html', - 'adm/rat/extpickframe.html'], + '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 = (); @@ -32,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); } } @@ -44,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); } } @@ -61,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); } } }