[LON-CAPA-cvs] cvs: doc(version_2_11_X) /loncapafiles removenolongerused.piml

raeburn raeburn at source.lon-capa.org
Fri Aug 9 02:29:14 EDT 2013


raeburn		Fri Aug  9 06:29:14 2013 EDT

  Modified files:              (Branch: version_2_11_X)
    /doc/loncapafiles	removenolongerused.piml 
  Log:
  - For 2.11
    - Backport 1.2
  
  
Index: doc/loncapafiles/removenolongerused.piml
diff -u doc/loncapafiles/removenolongerused.piml:1.1.2.1 doc/loncapafiles/removenolongerused.piml:1.1.2.2
--- doc/loncapafiles/removenolongerused.piml:1.1.2.1	Wed Aug  7 18:30:49 2013
+++ doc/loncapafiles/removenolongerused.piml	Fri Aug  9 06:29:14 2013
@@ -5,7 +5,7 @@
 <target dist="default"></target>
 <perlscript mode="fg">
 
-use File::Path qw(remove_tree);
+use File::Path();
 
 my %paths = (
               'londaemons' => '/home/httpd/perl',
@@ -55,12 +55,13 @@
 if (@dirstodelete > 0) {
     print "\nThe following directories were installed for an earlier version of LON-CAPA, and are no longer needed. It is recommended that you delete them. For each one, enter Y if you would the directory to be deleted.\n\n";
     foreach my $dir (@dirstodelete) {
-        next if (($dir =~/*/) || ($dir eq '') || ($dir eq '/'));  
+        next if (($dir =~/\*/) || ($dir eq '') || ($dir eq '/'));  
         print "$dir  -- delete? Enter: Y or N:\n";
         my $choice=<>;
         chomp($choice);
-        if ($choice==Y) {
-            remove_tree($dir);
+        $choice =~ s/\s+//g;
+        if ($choice eq 'Y') {
+            File::Path::remove_tree($dir);
         }
     }
 }
@@ -68,11 +69,12 @@
 if (@filestodelete > 0) {
    print "\nThe following files were installed for an earlier version of LON-CAPA, and are no longer needed. It is recommended that you delete them. For each one, enter Y if you would the file to be deleted.\n\n";
     foreach my $file (@filestodelete) {
-        next if (($file =~/*/) || ($file eq '') || ($file eq '/'));
+        next if (($file =~/\*/) || ($file eq '') || ($file eq '/'));
         print "$file -- remove? Enter? Y or N:\n";
         my $choice=<>;
         chomp($choice);
-        if ($choice==Y) {
+        $choice =~ s/\s+//g;
+        if ($choice eq 'Y') {
             unlink($file);
         }
     }




More information about the LON-CAPA-cvs mailing list