diff --git a/kdesvn-build b/kdesvn-build index 20d340c..d242b6a 100755 --- a/kdesvn-build +++ b/kdesvn-build @@ -74,7 +74,7 @@ my @install_fail; # List of modules that failed to install. my $install_flag; # True if we're in install mode. my $BUILD_ID; # Used by logging subsystem to create a unique log dir. my $LOG_DATE; # Used by logging subsystem to create logs in same dir. -my $rcfile = "$ENV{HOME}/.kdesvn-buildrc"; +my @rcfiles = ("./kdesvn-buildrc", "$ENV{HOME}/.kdesvn-buildrc2"); # Colors my ($RED, $GREEN, $YELLOW, $NORMAL, $BOLD) = ("") x 5; @@ -870,14 +870,18 @@ sub setenv # default set of options. sub no_config_whine { + my $searched = join("\n ", @rcfiles); + my $homepage = "http://grammarian.homelinux.net/kdesvn-build/"; + print <<"HOME"; -Unable to open configuration file: $rcfile! -$! +Unable to open configuration file! +We looked for: + $searched kdesvn-build will continue using a default set of options. These options may not apply to you, so feel free to visit the kdesvn-build homepage -http://grammarian.homelinux.net/kdesvn-build/ +$homepage and use the configuration file generator to guide you through the process of creating a config file to customize your kdesvn-build process. @@ -919,7 +923,37 @@ sub setup_default_modules() sub read_options { # The options are stored in the file $rcfile - open CONFIG, "<$rcfile" or do { no_config_whine(); return; }; + my $success = 0; + my $rcfile; + for $rcfile (@rcfiles) + { + if (open CONFIG, "<$rcfile") + { + $success = 1; + last; + } + } + + if (not $success) + { + if(scalar @rcfiles == 1) + { + # This can only happen if the user uses --rc-file, if we fail to + # load the file, we need to fail to load. + print <