[LON-CAPA-cvs] cvs: loncom /build/system_dependencies sqltest.pl
harris41
lon-capa-cvs@mail.lon-capa.org
Tue, 06 Aug 2002 23:38:27 -0000
harris41 Tue Aug 6 19:38:27 2002 EDT
Modified files:
/loncom/build/system_dependencies sqltest.pl
Log:
improve error handling for reading configuration files
Index: loncom/build/system_dependencies/sqltest.pl
diff -u loncom/build/system_dependencies/sqltest.pl:1.6 loncom/build/system_dependencies/sqltest.pl:1.7
--- loncom/build/system_dependencies/sqltest.pl:1.6 Tue Aug 6 19:18:25 2002
+++ loncom/build/system_dependencies/sqltest.pl Tue Aug 6 19:38:27 2002
@@ -2,7 +2,7 @@
# sqltest.pl - script to test MySQL database connectivity for LON-CAPA
#
-# $Id: sqltest.pl,v 1.6 2002/08/06 23:18:25 harris41 Exp $
+# $Id: sqltest.pl,v 1.7 2002/08/06 23:38:27 harris41 Exp $
#
###
@@ -278,8 +278,10 @@
# --------- configuration_scan: look for PerlSetVar and store in hash variable.
sub configuration_scan {
my ($storagehashref,$filename)=@_;
- open(CONFIG,$filename) ||
- (print "Can't read $filename\n" && exit);
+ # deprecated support for access.conf
+ open(CONFIG,$filename) or
+ ($filename=~/access\.conf$/ and return) or
+ (print("Can't read $filename\n") && exit(1));
while (my $configline=<CONFIG>) {
if ($configline =~ /^[^\#]*PerlSetVar/) {
my ($dummy,$varname,$varvalue)=split(/\s+/,$configline);