From 147b25fc1aa8ed1501818e5918b69c8e4fe95c09 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 14 Nov 2004 22:39:13 +0000 Subject: handle empty environment better - we would whine when HOME is not set previously. --- Echolot/Config.pm | 18 +++++++++--------- NEWS | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Echolot/Config.pm b/Echolot/Config.pm index 147e98e..5ef4fda 100644 --- a/Echolot/Config.pm +++ b/Echolot/Config.pm @@ -68,15 +68,15 @@ sub init($) { die ("Basedir is not defined\n") unless defined $params->{'basedir'}; - my @CONFIG_FILES = - ( $ENV{'ECHOLOT_CONF'}, - $params->{'basedir'}.'/pingd.conf', - $ENV{'HOME'}.'/echolot/pingd.conf', - $ENV{'HOME'}.'/pingd.conf', - $ENV{'HOME'}.'/.pingd.conf', - '/etc/echolot/pingd.conf', - '/etc/pingd.conf' ); - + my @CONFIG_FILES = (); + push(@CONFIG_FILES, $ENV{'ECHOLOT_CONF'}) if defined $ENV{'ECHOLOT_CONF'}; + push(@CONFIG_FILES, $params->{'basedir'}.'/pingd.conf') if defined $params->{'basedir'}; + push(@CONFIG_FILES, $ENV{'HOME'}.'/echolot/pingd.conf') if defined $ENV{'HOME'}; + push(@CONFIG_FILES, $ENV{'HOME'}.'/pingd.conf') if defined $ENV{'HOME'}; + push(@CONFIG_FILES, $ENV{'HOME'}.'/.pingd.conf') if defined $ENV{'HOME'}; + push(@CONFIG_FILES, '/etc/echolot/pingd.conf'); + push(@CONFIG_FILES, '/etc/pingd.conf'); + my $DEFAULT; $DEFAULT = { # System Specific Options diff --git a/NEWS b/NEWS index ddc30ec..9708477 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ Changes in version - script * debian: Create echolot user group in proper gid space. * debian: remove debconf stuff. + * handle empty environment better - we would whine when + HOME is not set previously. Changes in version 2.1.6 - 2004-08-07 * Catch a possible use of undefined values in a log trace() call. -- cgit v1.2.3