[LON-CAPA-cvs] cvs: loncom / UPDATE /build Makefile doc/loncapafiles removenolongerused.piml

raeburn raeburn at source.lon-capa.org
Fri Aug 9 02:24:32 EDT 2013


raeburn		Fri Aug  9 06:24:32 2013 EDT

  Modified files:              
    /doc/loncapafiles	removenolongerused.piml 
    /loncom	UPDATE 
    /loncom/build	Makefile 
  Log:
  - Checking for files installed by earlier versions of LON-CAPA, now no longer used.
    - Fix regexps and comparisons.
    - Output from parsing removenolongerused.piml sent to file in /tmp, then run
      interactively (user input required).
    - "make removenolongerused" moved out of postinstall and into separate call in ./UPDATE  
  
  
Index: doc/loncapafiles/removenolongerused.piml
diff -u doc/loncapafiles/removenolongerused.piml:1.1 doc/loncapafiles/removenolongerused.piml:1.2
--- doc/loncapafiles/removenolongerused.piml:1.1	Wed Aug  7 18:20:22 2013
+++ doc/loncapafiles/removenolongerused.piml	Fri Aug  9 06:24:21 2013
@@ -5,7 +5,7 @@
 <target dist="default"></target>
 <perlscript mode="fg">
 
-use File::Path qw(remove_tree);
+use File::Path();
 
 my @rcgifs = qw(anno.gif anot.gif anot2.gif back.gif bchat.gif bkm.gif blog.gif brws.gif catalog.gif ccat.gif ccrs.gif chrt.gif clst.gif com.gif conf.gif courses.gif cprv.gif cstr.gif del.gif docs.gif egrd.gif enrl.gif eval.gif fdbk.gif forw.gif grds.gif grps.gif keys.gif ledsend.gif list.gif logout.gif mail.gif mcrs.gif mrk.gif nav.gif new.gif parm.gif pcsrt.gif pcstr.gif pdfupload.gif pgrd.gif port.gif pparm.gif pref.gif prt.gif pub.gif rcrs.gif reload.gif remotebg.gif res.gif roles.gif rsrv.gif rtrv.gif sbkm.gif sctr.gif spacer.gif sprs.gif src.gif srvr.gif stat.gif subm.gif title.gif vbkm.gif);
 
@@ -80,12 +80,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);
         }
     }
 }
@@ -93,11 +94,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);
         }
     }
@@ -110,9 +112,10 @@
           "Remove? Y or N:\n";
     my $choice=<>;
     chomp($choice);
-    if ($choice==Y) {
+    $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);
         }
     }
Index: loncom/UPDATE
diff -u loncom/UPDATE:1.3 loncom/UPDATE:1.4
--- loncom/UPDATE:1.3	Thu Mar 10 16:08:24 2011
+++ loncom/UPDATE	Fri Aug  9 06:24:27 2013
@@ -8,6 +8,7 @@
 make configinstall
 make updatequery
 make hosts_and_domain_tab
+make removenolongerused
 make postinstall
 make run_searchcat
 CMD
Index: loncom/build/Makefile
diff -u loncom/build/Makefile:1.204 loncom/build/Makefile:1.205
--- loncom/build/Makefile:1.204	Wed Aug  7 22:35:29 2013
+++ loncom/build/Makefile	Fri Aug  9 06:24:32 2013
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 
-# $Id: Makefile,v 1.204 2013/08/07 22:35:29 raeburn Exp $
+# $Id: Makefile,v 1.205 2013/08/09 06:24:32 raeburn Exp $
 
 # TYPICAL USAGE of this Makefile is primarily for two targets:
 # "make build" and "make install".
@@ -529,8 +529,7 @@
 
 removenolongerused:
 	cat $(SOURCE)/doc/loncapafiles/removenolongerused.piml | \
-	perl piml_parse.pl  $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \
-	tee -a WARNINGS
+	perl piml_parse.pl  $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH)
 
 postinstall:
 	make postaboutVERSION
@@ -557,7 +556,6 @@
 	make mimetex_version_check
 	make verify_domconfiguser
 	make latex_fmtutil
-	make removenolongerused
 	sed -i "s/\x08\x08*/.../g" WARNINGS
 VERSION:
 	install -d $(TARGET)/etc




More information about the LON-CAPA-cvs mailing list