From 40d6ddb38325c82ed9811dad4e25cfd8677e1c2a Mon Sep 17 00:00:00 2001 From: tipaul Date: Fri, 20 Dec 2002 13:54:31 +0000 Subject: [PATCH] checks that the config file passed in parameter exist, otherwise, uses the default one (/etc/koha.conf) useful in upgradedb2marc.pl script. * if this script is called during installation, uses /etc/koha.conf.tmp * if it's called manually (after installation), uses /etc/koha.conf, as the tmp file is no more here :-) --- C4/Context.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Context.pm b/C4/Context.pm index 265a1818d8..b1efd7b03e 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -169,6 +169,8 @@ sub new my $conf_fname = shift; # Config file to load my $self = {}; + # check that the specified config file exists + undef $conf_fname unless (-e $conf_fname); # Figure out a good config file to load if none was specified. if (!defined($conf_fname)) { @@ -177,7 +179,6 @@ sub new $conf_fname = $ENV{"KOHA_CONF"} || CONFIG_FNAME; } - $self->{"config_file"} = $conf_fname; # Load the desired config file. -- 2.39.5