[libvirt] [PATCH] build: Fix prohibit_int_ijk (and iijjkk) on RHEL 5

Eric Blake eblake at redhat.com
Wed Oct 23 09:46:46 UTC 2013


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131023/2e228975/attachment-0001.sig>


More information about the libvir-list mailing list