'perl update-davical-database' did not find the intended config file / patchdir

people may use that invocation in addition to calling
/usr/share/davical/dba/update-debian-database, and happen upon a
cryptic error when YAML tries to parse dba/update-davical-database
instead of config/administration.yml
This commit is contained in:
Florian Schlichting 2017-10-09 10:17:03 +02:00
parent 5dc4aed87c
commit 7674fe9831

View File

@ -26,8 +26,8 @@ my $force_owner = "";
my $config_file = "config/administration.yml";
my $dbadir = $0;
$dbadir =~ s#/[^/]*$##;
my $patchdir = $dbadir . "/patches";
$dbadir =~ s#[^/]*$##;
my $patchdir = $dbadir . "patches";
#
# We look in a few places for the config file. First relative to
@ -35,7 +35,7 @@ my $patchdir = $dbadir . "/patches";
# start to look in absolute locations. Then we give up :-)
if ( ! -f $config_file ) {
$config_file = $0;
$config_file =~ s{[^/]+/update-[a-z]+-database}{config/administration.yml};
$config_file =~ s{update-[a-z]+-database}{../config/administration.yml};
}
if ( ! -f $config_file ) {
$config_file = "/etc/davical/administration.yml";