Re: WIP pgindent replacement - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: WIP pgindent replacement
Date
Msg-id 501C13A2.5070105@dunslane.net
Whole thread Raw
In response to Re: WIP pgindent replacement  (Bruce Momjian <bruce@momjian.us>)
Responses Re: WIP pgindent replacement
List pgsql-hackers
On 08/03/2012 01:23 PM, Bruce Momjian wrote:
> On Fri, Aug  3, 2012 at 12:51:03PM -0400, Andrew Dunstan wrote:
>> On 08/03/2012 10:51 AM, Bruce Momjian wrote:
>>
>>
>>> OK, sure, we can keep the pgindent name --- I was just trying to be
>>> consistent.  One problem with the lack of an extension is that there is
>>> no easy way for the Perl cleanup instructions to find all the Perl
>>> executables --- right now it looks for an extension.  Do we have other
>>> Perl scripts in our tree that don't end in *.pl or *.pm?  I didn't find
>>> any with this script:
>>>
>>>     $ find . -type f -exec file {} \;|grep Perl
>>>     ./src/backend/catalog/Catalog.pm: Perl5 module source text
>>>     ./src/tools/msvc/MSBuildProject.pm: Perl5 module source text
>>>     ./src/tools/msvc/Project.pm: Perl5 module source text
>>>     ./src/tools/msvc/Mkvcbuild.pm: Perl5 module source text
>>>     ./src/tools/msvc/Install.pm: Perl5 module source text
>>>     ./src/tools/msvc/Solution.pm: Perl5 module source text
>>>     ./src/tools/msvc/VCBuildProject.pm: Perl5 module source text
>>>     ./src/tools/msvc/VSObjectFactory.pm: Perl5 module source text
>> Try:
>>
>>     find . -exec file {} \; | egrep 'perl script|perl -w script|Perl5
>>     module'
> OK, I used:
>
> $ find . -type f -exec file {} \;|
>     egrep -i 'perl.*(script|module)'|grep -v '\.p[lm]:'
>
> and got:
>
> ./src/pl/plperl/ppport.h: awk script text
> ./src/tools/pginclude/pgcheckdefines: a /usr/bin/perl -w script text executable
> ./src/tools/git_changelog: a /usr/bin/perl script text executable
>
> The last two are Perl scripts without Perl file extensions, so let's
> just go with 'pgindent' and I will hard-code those into the perltidy
> instructions.
>



Your pattern has produced a false positive, though. Wouldn't it be 
better not to hardcode anything?

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: SPGiST versus hot standby - question about conflict resolution rules
Next
From: Fabien COELHO
Date:
Subject: Re: pg_dump custom format without timestamp?