--- loncom/build/system_dependencies/perltest.pl 2002/08/14 16:52:41 1.6 +++ loncom/build/system_dependencies/perltest.pl 2002/11/04 01:57:53 1.9 @@ -2,7 +2,7 @@ # perltest.pl - script to test the status of perl modules on a LON-CAPA system # -# $Id: perltest.pl,v 1.6 2002/08/14 16:52:41 harris41 Exp $ +# $Id: perltest.pl,v 1.9 2002/11/04 01:57:53 harris41 Exp $ # ### @@ -32,7 +32,7 @@ This script is invoked by test-related t F. This script is also used as a CGI script and is installed -at the file location of F. +at the file location of F. MODE, when left blank, the output defaults to 'statusreport' mode. Except however, if $ENV{'QUERY_STRING'} exists, in which case @@ -164,7 +164,7 @@ Foundation, Inc., 59 Temple Place, Suite =cut # =================================== Process version information of this file. -my $VERSION = sprintf("%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/); +my $VERSION = sprintf("%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/); # ========================== Determine the mode that this script should run in. my $mode; @@ -187,11 +187,14 @@ if ($mode eq "html") { print(< + CPAN perl status report; $hostname; $date - +

CPAN perl status report

 END
@@ -431,55 +434,67 @@ print("\n".'SYNOPSIS'."\n");
 
 # ========================================================== The stable report.
 print('**** STABLE REPORT (what a production server should worry about)'."\n");
-if (@stable_missing) {
+if (@stable_missing)
+  {
     print('There are '.scalar(@stable_missing).' CPAN distributions missing '.
 	  'from this LON-CAPA system.'."\n");
-}
-else {
+  }
+else
+  {
     print('All perl modules needed by LON-CAPA appear to be present.'."\n");
-}
-if (@stable_outdated) {
+  }
+if (@stable_outdated)
+  {
     print(scalar(@stable_outdated).' CPAN distributions are out-dated '.
 	  'on this LON-CAPA system.'."\n");
-}
-if (@stable_veryokay) {
+  }
+if (@stable_veryokay)
+  {
     print(scalar(@stable_veryokay).' CPAN distributions are an exact match '.
 	  '(based on version number).'."\n");
 #    print @stable_veryokay;
-}
-if (@stable_okay) {
+  }
+if (@stable_okay)
+  {
     print(scalar(@stable_okay).' CPAN dists have a version number '.
 	  'higher than expected'.
 	  ' (probably okay).'. "\n");
-}
+  }
 print("\n");
 
 # ===================================================== The development report.
 print('**** DEVELOPMENT REPORT (do not worry about this unless you are a'.
       ' coder)'."\n");
-if (@dev_missing) {
+if (@dev_missing)
+  {
     print('There are '.scalar(@dev_missing).' CPAN distributions missing '.
 	  'from this LON-CAPA system.'."\n");
-}
-else {
+  }
+else
+  {
     print('All perl modules needed by LON-CAPA appear to be present.'."\n");
-}
-if (@dev_outdated) {
+  }
+if (@dev_outdated)
+  {
     print(scalar(@dev_outdated).' CPAN distributions are out-dated '.
 	  'on this LON-CAPA system.'."\n");
-}
-if (@dev_veryokay) {
+  }
+if (@dev_veryokay)
+  {
     print(scalar(@dev_veryokay).' CPAN distributions are an exact match '.
 	  '(based on version number).'."\n");
 #    print @dev_veryokay;
-}
-if (@dev_okay) {
+  }
+if (@dev_okay)
+  {
     print(scalar(@stable_okay).' CPAN dists have a version number '.
 	  'higher than expected'.
 	  ' (probably okay).'. "\n");
-}
+  }
 
-if ($mode eq 'synopsis') {
+my $detailstream;
+if ($mode eq 'synopsis')
+  {
     print("\n".'**** NOTE ****'."\n".
 	  'After everything completes, please view the CPAN_STATUS_REPORT'.
 	  ' file for more '."\n".'information on resolving your perl modules.'.
@@ -487,48 +502,59 @@ if ($mode eq 'synopsis') {
 
     print('* HIT RETURN WHEN READY TO CONTINUE *'."\n");
     my $returnkey=<>;
-}
-else {
-    print("\n".'DETAILED STATUS REPORT'."\n"); # Header of status report.
-
-    # Print advisory notices.
-    print("\n".'(Consult loncapa/doc/otherfiles/perl_modules.txt for '.
-	  'information on'."\n".
-	  ' manual build instructions.)'."\n");
-    print("\n".'(**** IMPORTANT NOTICE **** HTML-Parser needs to be patched '.
-	  "\n".' as described in loncapa/doc/otherfiles/perl_modules.txt)'.
-	  "\n");
+    open(OUT,'>CPAN_STATUS_REPORT');
+    $detailstream=\*OUT;
+  }
+else
+  {
+    $detailstream=\*STDOUT;
+  }
+print($detailstream 
+      "\n".'DETAILED STATUS REPORT'."\n"); # Header of status report.
 
-    print("\n".'For manual installation of CPAN distributions, visit'."\n".
-	  'http://search.cpan.org/dist/DistName'."\n".
-	  'where DistName is something like "HTML-Parser" or "libwww-perl".'.
-	  "\n");
+# Print advisory notices.
+print($detailstream
+      "\n".'(Consult loncapa/doc/otherfiles/perl_modules.txt for '.
+      'information on'."\n".
+      ' manual build instructions.)'."\n");
+print($detailstream
+      "\n".'(**** IMPORTANT NOTICE **** HTML-Parser needs to be patched '.
+      "\n".' as described in loncapa/doc/otherfiles/perl_modules.txt)'.
+      "\n");
+
+print($detailstream
+      "\n".'For manual installation of CPAN distributions, visit'."\n".
+      'http://search.cpan.org/dist/DistName'."\n".
+      'where DistName is something like "HTML-Parser" or "libwww-perl".'.
+      "\n");
+
+print($detailstream
+      "\n".'For automatic installation of CPAN distributions, visit'."\n".
+      'http://install.lon-capa.org/resources/cpanauto/DistName.bin'."\n".
+      'where DistName.bin is something like "HTML-Parser.bin" or '.
+      '"libwww-perl.bin".'."\n");
+
+# Print detailed report of stable.
+print($detailstream
+      "\n".'STABLE (DETAILED REPORT)'."\n");
+print $detailstream @stable_missing;
+print $detailstream @stable_outdated;
+print $detailstream @stable_veryokay;
+print $detailstream @stable_okay;
+print($detailstream "\n".'DEVELOPMENT (DETAILED REPORT)'."\n");
+print $detailstream @dev_missing;
+print $detailstream @dev_outdated;
+print $detailstream @dev_veryokay;
+print $detailstream @dev_okay;
 
-    print("\n".'For automatic installation of CPAN distributions, visit'."\n".
-	  'http://install.lon-capa.org/resources/cpanauto/DistName.bin'."\n".
-	  'where DistName.bin is something like "HTML-Parser.bin" or '.
-	  '"libwww-perl.bin".'."\n");
-
-    # Print detailed report of stable.
-    print("\n".'STABLE (DETAILED REPORT)'."\n");
-    print @stable_missing;
-    print @stable_outdated;
-    print @stable_veryokay;
-    print @stable_okay;
-    print("\n".'DEVELOPMENT (DETAILED REPORT)'."\n");
-    print @dev_missing;
-    print @dev_outdated;
-    print @dev_veryokay;
-    print @dev_okay;
-}
-
-if ($mode eq "html") {
+if ($mode eq "html")
+  {
     print(<
 
 
 END
-}
+  }
 
 # ================================================================ Subroutines.
 # Note that "vers_cmp" and "have_vers" are adapted from a bugzilla version 2.16