[LON-CAPA-cvs] cvs: loncom /build/system_dependencies sqltest.pl

harris41 lon-capa-cvs@mail.lon-capa.org
Thu, 16 May 2002 19:03:56 -0000


harris41		Thu May 16 15:03:56 2002 EDT

  Modified files:              
    /loncom/build/system_dependencies	sqltest.pl 
  Log:
  need to read values from loncapa_apache.conf to get lonSqlAccess
  
  
Index: loncom/build/system_dependencies/sqltest.pl
diff -u loncom/build/system_dependencies/sqltest.pl:1.4 loncom/build/system_dependencies/sqltest.pl:1.5
--- loncom/build/system_dependencies/sqltest.pl:1.4	Sat May 11 17:33:30 2002
+++ loncom/build/system_dependencies/sqltest.pl	Thu May 16 15:03:56 2002
@@ -64,6 +64,16 @@
     }
 }
 close(CONFIG);
+open (CONFIG,"/etc/httpd/conf/loncapa_apache.conf") || 
+    (print "Can't read loncapa_apache.conf\n" && exit);
+while (my $configline=<CONFIG>) {
+    if ($configline =~ /^[^\#]*PerlSetVar/) {
+	my ($dummy,$varname,$varvalue)=split(/\s+/,$configline);
+        chomp($varvalue);
+        $perlvar{$varname}=$varvalue;
+    }
+}
+close(CONFIG);
 unless ($perlvar{'lonRole'} eq 'library') {
     print "SQL testing can only be run on a library server. Skipping test..\n";
     exit 0;