[libvirt] [PATCH 2/3] syntax-check: Only allows to include public headers in external tools

Eric Blake eblake at redhat.com
Wed Apr 17 20:09:32 UTC 2013


On 04/17/2013 04:19 AM, Osier Yang wrote:
> With this patch, include public headers in "" form is only allowed
> for "internal.h". And only the external tools (examples|tools|python
> |include/libvirt) can include the public headers in <> form.
> ---
>  cfg.mk                         | 17 ++++++++++++++---
>  include/libvirt/libvirt-lxc.h  |  2 +-
>  include/libvirt/libvirt-qemu.h |  2 +-
>  python/libvirt-lxc-override.c  |  4 ++--
>  python/libvirt-override.c      |  4 ++--
>  python/libvirt-qemu-override.c |  4 ++--
>  python/typewrappers.h          |  4 ++--
>  tests/shunloadhelper.c         |  5 ++---
>  tools/virsh.c                  |  4 ++--
>  9 files changed, 28 insertions(+), 18 deletions(-)
> 
> diff --git a/cfg.mk b/cfg.mk
> index 5f422de..4128ebb 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -747,12 +747,20 @@ sc_prohibit_duplicate_header:
>  	fi;
>  
>  # Don't include "libvirt/*.h" in "" form.
> -sc_prohibit_include_public_headers:
> +sc_prohibit_include_public_headers_quote:
>  	@prohibit='# *include *"libvirt/.*\.h"'				\
>  	in_vc_files='\.[chx]$$'						\
>  	halt='Do not include libvirt/*.h in internal source'		\
>  	  $(_sc_search_regexp)
>  
> +# Don't include "libvirt/*.h" in <> form. Except for external tools,
> +# e.g. Python binding, examples and tools subdirectories.
> +sc_prohibit_include_public_headers_brackets:
> +	@prohibit='# *include *<libvirt/.*\.h>'				\
> +	in_vc_files='\.[chx]$$'						\

Change this to [ch] (we found out this morning that [chx] is too strict,
if 'dwarves' is installed).

ACK with that tweak.

-- 
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/20130417/e2334b0a/attachment-0001.sig>


More information about the libvir-list mailing list