[libvirt] Syntax check rules broken if 'exclude' is not defined

Eric Blake eblake at redhat.com
Thu Mar 29 23:16:05 UTC 2012


On 03/29/2012 07:17 AM, Daniel P. Berrange wrote:
> I noticed that many (most) of the libvirt syntax-check rules were not
> generating any results, despite me introducing obvious violations.
> 
>>From my debugging the problem appears to be caused by this commit:
> 
>   commit 727075d03c670affa68f71313979781f5ba9bbfc
>   Author: Eric Blake <eblake at redhat.com>
>   Date:   Thu Mar 1 14:51:31 2012 -0700
> 
>     maint.mk: add per-line exclusions to prohibitions
> 
> 
> If I revert the following hunk from maint.mk
> 
> 
> @@ -258,6 +268,7 @@ define _sc_search_regexp
>     if test -n "$$files"; then                                          \
>       if test -n "$$prohibit"; then                                     \
>         grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
> +         | grep -vE "$${exclude-^$$}"                                  \
>           && { msg="$$halt" $(_sc_say_and_exit) } || :;                 \
>       else                                                              \
>         grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
> 
> 
> then the syntax-check rules work again. It seems that this grep is
> broken, if a test leaves  $exclude undefined, causing it to filter
> out all results.

I think I figured out why, but I'm still working out how to fix it.

cfg.mk is included _before_ maint.mk.  Therefore, $_sc_search_regexp) is
expanded in cfg.mk prior to the place where maint.mk provides a default
definition for $(exclude), so we are getting the wrong thing expanded,
which breaks the syntax check rule in cfg.mk.

I'll get something working, hopefully later today.

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120329/7c85a1e5/attachment-0001.sig>


More information about the libvir-list mailing list