1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Use a more portable way to get the version string in PostgresNode

Older versions of perl on Windows don't like the list form of pipe open,
and perlcritic doesn't like the string form of open, so we avoid both
with a simpler formulation using qx{}.

Per complaint from Amit Kapila.
This commit is contained in:
Andrew Dunstan
2021-05-20 08:03:15 -04:00
parent 413c1ef98e
commit 8bdd6f563a

View File

@ -1248,10 +1248,8 @@ sub _set_pg_version
local %ENV = $self->_get_env(); local %ENV = $self->_get_env();
# We only want the version field # We only want the version field
open my $fh, "-|", $pg_config, "--version" my $version_line = qx{$pg_config --version};
or BAIL_OUT("$pg_config failed: $!"); BAIL_OUT("$pg_config failed: $!") if $?;
my $version_line = <$fh>;
close $fh or die;
$self->{_pg_version} = PostgresVersion->new($version_line); $self->{_pg_version} = PostgresVersion->new($version_line);