[postgis-devel] [postgis-users] PostGIS 2.4.0rc2 released
Greg Troxel
gdt at lexort.com
Tue Sep 26 06:19:49 PDT 2017
Sandro Santilli <strk at kbt.io> writes:
> On Mon, Sep 25, 2017 at 08:18:11PM -0400, Greg Troxel wrote:
>
>> ! find . -name '*.c' -o -name '*.h' | \
>> grep -vf .gitignore | \
>> xargs grep -Pn '[\t ]$'
>> grep: .gitignore: No such file or directory
>> GNUmakefile:41: recipe for target 'check-no-trailing-blanks' failed
>
> BTW, as I don't get this failure on my system, I'm wondering what
> shell are you using ? Can you think of a portable way to add the
> `pipefail` behavior to the above call ?
I think it is NetBSD's /bin/sh; SHELL and CONFIG_SHELL are /bin/hsh. As
far as I know it meets POSIX.
If I run something similar by hand:
$ ls | grep -vf .nonexistent | xargs who
grep: .nonexistent: No such file or directory
$ echo $?
0
that seems to behave as I would expect. The grep returns 2, which I
think is also correct.
But, grep doesn't have a -P option:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html
and NetBSD's grep conforms :-)
$ who | grep -Pn foo
grep: The -P option is not supported
$ echo $?
2
Also, NetBSD's xargs, when given zero arguments, does not invoke the
command, whereas GNU xargs always runs the command once (with no
arguments). That may be part of the surprising pass/fail results. It
seems the grep invocation should fail (2) and output no content, so
xargs would make zero invocations, and happily return 0
$ cat /dev/null | xargs foobar
$ echo $?
0
which is what should happen if grep fails to find trailing space on
every invocation.
My suggestion for the gitignore issue would to somewhere, see if
.gitignore exists (or maybe, check if this is a release vs a from-vcs
build), and to use /dev/null.
A less clean but easier fix would be "touch .gitignore". That's what I
did as a workaround to be able to run the rest of the tests.
My overall suggestion is to back out this change, as it doesn't fix a
bug in the beta1/rc1/etc. (Really, just to drop the no-trailing-blanks
token from the check dependencies.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 162 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170926/1b8cdd56/attachment.sig>
More information about the postgis-devel
mailing list