Re: [PATCH 06/10] syntax-check: Don't include "libvirt.h" and "virterror.h" in "" form

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/16/2013 07:41 AM, Osier Yang wrote:
> Directories python/tools/examples should include them in <> form,
> though this patch allows "" form in these directories by excluding
> them, a later patch will do the cleanup.
> ---
>  cfg.mk | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 

> +# Don't include "libvirt/libvirt.h" in "" form.
> +sc_prohibit_include_libvirt_h:
> +	@prohibit='^# *include *"libvirt/libvirt\.h"'			\
> +	in_vc_files='\.[ch]$$'						\
> +	halt='Do not include libvirt/libvirt.h'				\
> +	  $(_sc_search_regexp)
> +
> +# Don't include "libvirt/virterror.h" in "" form.
> +sc_prohibit_include_virterror_h:
> +	@prohibit='^# *include *"libvirt/virterror\.h"'			\

Combine these into one rule, for faster execution of 'make
syntax-check'.  Also, while we generally use #include with # in column
1, C allows it in later columns and a stronger test avoids an anchor
(but if that opens up false negatives, then adding the anchor back in is
fine).

@prohibit='# *include *"libvirt/*\.h"'

> +	in_vc_files='\.[ch]$$'						\

Another case where .[chx] might be better, since we cleaned up .x files.

> +	halt='Do not include libvirt/virterror.h'			\

This halt message needs alteration when you merge the two checks into one.


> +
> +exclude_file_name_regexp--sc_prohibit_include_libvirt_h = \
> +  ^(src/internal\.h)|(include/libvirt/libvirt-(lxc|qemu)\.h)|(python/libvirt-override\.c)|(python/typewrappers\.h)$$
> +
> +exclude_file_name_regexp--sc_prohibit_include_virterror_h = \
> +  ^(src/internal\.h)|(python/libvirt-|(lxc|qemu)-override\.c)|(python/typewrappers\.h)$$

and if you merge the rules, come up with a common name, and then you
only need one exclude rule.  If we are excluding entire directories, we
could write this more compact as:


^(src/internal\.h$$\|python/\|tools/\|examples/\|include/libvirt/libvirt-*\.h$$)

-- 
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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]