Stop complaining about the configuration file missing -- if it is not there then just assume there is nothing to worry about. This makes the output of the initial run with the 'setup' argument a lot quieter.

git-svn-id: svn://10.0.0.236/trunk@107649 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ian%hixie.ch 2001-11-08 05:06:27 +00:00
parent 04036664cd
commit 97db51b03d

View File

@ -147,12 +147,17 @@ sub DESTROY {
sub doRead {
my $self = shift;
my($filename) = @_;
local *FILE; # ugh
$self->assert(open(FILE, "<$filename"), 1, "Could not open configuration file '$filename' for reading: $!");
local $/ = undef; # slurp entire file (no record delimiter)
my $settings = <FILE>;
$self->assert(close(FILE), 3, "Could not close configuration file '$filename': $!");
return $settings;
if (-e $filename) {
local *FILE; # ugh
$self->assert(open(FILE, "<$filename"), 1, "Could not open configuration file '$filename' for reading: $!");
local $/ = undef; # slurp entire file (no record delimiter)
my $settings = <FILE>;
$self->assert(close(FILE), 3, "Could not close configuration file '$filename': $!");
return $settings;
} else {
# file doesn't exist, so no configuration to read in
return '';
}
}
sub doWrite {