Skip to content
Snippets Groups Projects
Commit e1a35ab6 authored by Christoph Berg's avatar Christoph Berg 📡
Browse files

PgCommon.pm: Fix include directives parser, spotted by ironhalik, thanks!

parent d4a4aaad
No related branches found
No related tags found
No related merge requests found
......@@ -131,7 +131,7 @@ sub read_conf_file {
while (<F>) {
if (/^\s*(?:#.*)?$/) {
next;
} elsif(/^\s*include_dir\s+'([^']+)'\s*$/i) {
} elsif(/^\s*include_dir\s*=?\s*'([^']+)'\s*(?:#.*)?$/i) {
# read included configuration directory and merge into %conf
# files in the directory will be read in ascending order
my $path = $1;
......@@ -147,7 +147,7 @@ sub read_conf_file {
}
}
closedir($dir);
} elsif (/^\s*include(?:_if_exists)?\s+'([^']+)'\s*$/i) {
} elsif (/^\s*include(?:_if_exists)?\s*=?\s*'([^']+)'\s*(?:#.*)?$/i) {
# read included file and merge into %conf
my $path = $1;
my $absolute_path = get_absolute_path($path, $config_path);
......
......@@ -4,6 +4,7 @@ postgresql-common (190) UNRELEASED; urgency=medium
* pg_virtualenv: Error out if no server packages are installed.
* postgresql-common recommends e2fsprogs, we are using chattr in
pg_createcluster. (Closes: #887251)
* PgCommon.pm: Fix include directives parser, spotted by ironhalik, thanks!
-- Christoph Berg <myon@debian.org> Mon, 25 Dec 2017 18:03:38 +0100
......
......@@ -142,18 +142,18 @@ print F <<EOF;
# commented_str = 'notme'
intval = -1
include '8.4/test/foo.conf'
include_dir 'conf.d'
include '8.4/test/foo.conf' # foo
include_dir 'conf.d' # bar
strval = 'howdy'
include_if_exists '/nonexisting.conf'
include_if_exists '8.4/test/condinc.conf'
include_if_exists = '8.4/test/condinc.conf'
EOF
close F;
open F, ">$tdir/conf.d/sub.conf" or die "Could not create $tdir/conf.d/sub.conf: $!";
print F <<EOF;
subvalue = 1
include '../relative.conf'
include = '../relative.conf'
EOF
close F;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment