On 10/23/2013 09:33 AM, Claudio Bley wrote:

> Seems \s is buggy in this grep version with a non UTF-8 locale
> setting. Observe:
> 
> $ LANG=en_US.UTF-8 grep -nE '\<(int|unsigned) ([^(]* )*(i|j|k)(\s|,|;)' 
> src/conf/interface_conf.h
> $ LANG=C grep -nE '\<(int|unsigned) ([^(]* )*(i|j|k)(\s|,|;)' 
> src/conf/interface_conf.h

But 'syntax-check' should be already using grep in the C locale (if not,
that's a bug upstream in gnulib).

> According to grep's info pages \s should be equivalent to [[:space:]],
> but it is not, as the latter works alright:
> 
> $ LANG=C grep -nE '\<(int|unsigned) ([^(]*)*(i|j|k)([[:space:]]|,|;)' 
> src/conf/interface_conf.h 

If we go this route, we could simplify even further:

$ LANG=C grep -nE '\<(int|unsigned) ([^(] *)*[ijk][:space:],:]'
src/conf/interface_conf.h

> 
> So, I think the right fix would be to avoid \s altogether and use
> [[:space:]] instead.

The \s usage was good enough to work around the grep bug, which is all
the more we need to get the build working on RHEL 5, so I'm not worried
about further patches (unless upstream gnulib really does have a bug for
not using C locale).


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to