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.

This commit is contained in:
ian%hixie.ch 2001-11-08 05:06:27 +00:00
parent 10dc2574fd
commit f9a76a2609

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 {