[re-adding the list]
On 12/07/2011 02:36 PM, Pádraig Brady wrote:
> On 12/07/2011 08:52 PM, Eric Blake wrote:
>> +if test ! -d "$local_gl_dir" \
>> + || find "$local_gl_dir" -name '*.diff' -exec false {} +; then
>> + :
>> +else
>
> A small nit.
>
> I'm slightly wary with this first use of "find ... {} +" in gnulib.
> This would be more portable and clearer I think:
>
> if find "$local_gl_dir" -name '*.diff' 2>/dev/null | grep . >/dev/null; then
While it is true that POSIX 'find -exec blah {} +' isn't widely
supported yet, the only drawback of using it here is that if you are on
a system with ancient find, then find will (probably noisily) fail with
a syntax error, and the surrounding if/else will then require 'patch' as
an unconditional dependency, which isn't that bad. Most non-GNU/Linux
development systems already have patch, while the particular problem
that prompted this was a default Fedora install, where Fedora doesn't
install patch by default but does have a POSIX-compliant find.
Right now, I'm only 30% in favor of making this tweak, unless others can
speak up with more reasons why we must cater to older find. Any other
opinions?
--
Eric Blake [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
