Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Peter Eisentraut
On 3/28/17 05:23, Dagfinn Ilmari Mannsåker wrote: > I suggest splitting the substitution and filtering part into separate > map and grep calls, for clarity. The substituion is crying out for the > /r regex modifier to avoid the local variable, but that's only available > since perl 5.14. > > diff

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Dagfinn Ilmari Mannsåker
Andrew Dunstan writes: > On 03/28/2017 05:23 AM, Dagfinn Ilmari Mannsåker wrote: >> +@opts = grep { !/\$\(/ && /^--/ } >> +map { (my $x = $_) =~ >> s/\Q$(top_builddir)\E/\"$topdir\"/; $x;} >> +split(/\s+/, $1); >> > > The use of this lexi

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Andrew Dunstan
On 03/28/2017 07:31 AM, Dagfinn Ilmari Mannsåker wrote: > Andrew Dunstan writes: > >> I would try something like this: >> >> @opts = grep { $_ !~ /\$\(/ && $_ =~ /^--/ } >> map { s/\Q$(top_builddir)\E/\"$topdir\"/; } >> split(/\s+/, $1); > That map is not going to work: it'll m

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Dagfinn Ilmari Mannsåker
Andrew Dunstan writes: > I would try something like this: > > @opts = grep { $_ !~ /\$\(/ && $_ =~ /^--/ } > map { s/\Q$(top_builddir)\E/\"$topdir\"/; } > split(/\s+/, $1); That map is not going to work: it'll modify the values returned by split(), but s/// (without the /r modi

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Andrew Dunstan
On 03/28/2017 05:23 AM, Dagfinn Ilmari Mannsåker wrote: > + @opts = grep { !/\$\(/ && /^--/ } > + map { (my $x = $_) =~ > s/\Q$(top_builddir)\E/\"$topdir\"/; $x;} > + split(/\s+/, $1); > The use of this lexical $x variable seems entire

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Andrew Dunstan
On 03/27/2017 08:58 PM, Tom Lane wrote: > I wrote: >> Peter Eisentraut writes: >>> Clean up Perl code according to perlcritic >> This seems to have broken the regression tests (specifically, dblink) >> on at least some of the Windows buildfarm critters. > I'm hardly a Perl expert, but it looks t

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-28 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > I wrote: >> Peter Eisentraut writes: >>> Clean up Perl code according to perlcritic > >> This seems to have broken the regression tests (specifically, dblink) >> on at least some of the Windows buildfarm critters. > > I'm hardly a Perl expert, but it looks to me like the culpr

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-27 Thread Tom Lane
I wrote: > Peter Eisentraut writes: >> Clean up Perl code according to perlcritic > This seems to have broken the regression tests (specifically, dblink) > on at least some of the Windows buildfarm critters. I'm hardly a Perl expert, but it looks to me like the culprit is this hunk in vcregress.

Re: [HACKERS] [COMMITTERS] pgsql: Clean up Perl code according to perlcritic

2017-03-27 Thread Tom Lane
Peter Eisentraut writes: > Clean up Perl code according to perlcritic This seems to have broken the regression tests (specifically, dblink) on at least some of the Windows buildfarm critters. It looks like something got changed in the behavior of build-tree path expansion: this in the input/path