[libvirt] [PATCH] build: import latest gnulib

* .gnulib: Update to latest. * cfg.mk (sc_prohibit_test_minus_ao): Delete, it was moved into gnulib's maint.mk. --- Here's the full list of gnulib changes: * .gnulib 4f01268...e01b458 (44):
maint.mk: check for [ as well as test gnumakefile: don't squelch _version output sys_time: avoid compiler warnings maint.mk: split a long line maint.mk: s/_header_without_use/_sc_header_without_use/ maint: improve module indicators fdopendir: work around FreeBSD bug Emit #pragma system_header after the inclusion guard, not before. Fix indentation. save-cwd: don't leak a file descriptor when the caller execs Remove vestiges of fts-lgpl module. Fix definition of tests witness macro. Fix definition of tests witness macro. Fix ioctl's protoype on glibc systems. Normalize copyright line formatting. exclude: fix the case of globs vs. EXCLUDE_INCLUDE maint.mk: prohibit use of test's -o and -a operators Remove unused GNULIB_XYZ macro definitions. Mark privileged tests modules. Split C++ tests into separate tests modules. gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'. gnulib-tool: Add support for special categories of tests. ansi-c++-opt: Allow turning off the C++ build by default. unistd: Avoid #define replacements in C++ mode. Fix link errors on mingw. lib-ignore: Determine different options for different compilers. Remove unused GNULIB_XYZ macro definitions. Add a remark about certain modules. Resolve conflict between the two kinds of module indicators. autoupdate Distinguish two kinds of module indicators. New module description field 'Comment'. Addendum to 2010-02-07 commit. Use GNULIB_POSIXCHECK instead of GNULIB_PORTCHECK. Avoid side effects from tests-related modules on the compilation of lib. Factorize common .m4 code. Fix a compilation error on Cygwin with g++ >= 4.3. Rename gl_GETLOGIN. Rename gl_GETLOGIN_R. Rename gl_INET_NTOP. Rename gl_INET_PTON. Rename gl_MBSLEN. Rename gl_FORKPTY and gl_OPENPTY. top/maint.mk (sc_texinfo_acronym): Don't infloop if there is no *.texi files.
.gnulib | 2 +- cfg.mk | 8 -------- 2 files changed, 1 insertions(+), 9 deletions(-) diff --git a/.gnulib b/.gnulib index 4f01268..e01b458 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 4f01268d0c584c20704e42527f4fa125e7525aae +Subproject commit e01b458f40440e64ce6f59beb0b446219bb6302d diff --git a/cfg.mk b/cfg.mk index 2e7b68a..07360b0 100644 --- a/cfg.mk +++ b/cfg.mk @@ -272,14 +272,6 @@ sc_preprocessor_indentation: echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ fi -_m1 = use "test C1 && test C2", not "test C1 -''a C2" -_m2 = use "test C1 || test C2", not "test C1 -''o C2" -# Using test's -a and -o operators is not portable. -sc_prohibit_test_minus_ao: - @re='(\<test| \[+) .+ -[ao] ' \ - msg='$(_m1); $(_m2)' \ - $(_prohibit_regexp) - sc_copyright_format: @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \ | grep -v Inc \ -- 1.6.6.1

A lot of syntax check rules have to be rewritten, but the result is easier to maintain. I tested each syntax rule by intentionally introducing a temporary violation of the rule. Additionally, some false positives for unmarked_diagnostics crept in, and an improved copyright_format test caught some bugs. * .gnulib: Update to latest. * cfg.mk (sc_prohibit_test_minus_ao): Delete, it was moved into gnulib's maint.mk. (sc_avoid_write, sc_prohibit_strcmp_and_strncmp) (sc_prohibit_asprintf, sc_prohibit_strncpy, sc_prohibit_readlink) (sc_prohibit_gethostname, sc_prohibit_gettext_noop) (sc_prohibit_VIR_ERR_NO_MEMORY, sc_prohibit_nonreentrant) (sc_prohibit_ctype_h, sc_TAB_in_indentation) (sc_avoid_ctype_macros) (sc_prohibit_virBufferAdd_with_string_literal) (sc_prohibit_gethostby, sc_copyright_format): Rewrite in terms of new maint.mk macros. (sc_libvirt_unmarked_diagnostics): Fix whitespace. * .x-sc_unmarked_diagnostics: New file. * tests/object-locking.ml: Fix copyright. * tools/virt-pki-validate.in: Likewise. * tools/virt-xml-validate.in: Likewise. --- .gnulib | 2 +- .x-sc_unmarked_diagnostics | 2 + cfg.mk | 119 ++++++++++++++++++++------------------------ tests/object-locking.ml | 2 +- tools/virt-pki-validate.in | 2 +- tools/virt-xml-validate.in | 2 +- 6 files changed, 60 insertions(+), 69 deletions(-) create mode 100644 .x-sc_unmarked_diagnostics diff --git a/.gnulib b/.gnulib index 4f01268..097c9ce 160000 --- a/.gnulib +++ b/.gnulib @@ -1 +1 @@ -Subproject commit 4f01268d0c584c20704e42527f4fa125e7525aae +Subproject commit 097c9ce08a79899ff942b9b6ee811e613605499f diff --git a/.x-sc_unmarked_diagnostics b/.x-sc_unmarked_diagnostics new file mode 100644 index 0000000..4135cc7 --- /dev/null +++ b/.x-sc_unmarked_diagnostics @@ -0,0 +1,2 @@ +docs/apibuild.py +tests/virt-aa-helper-test diff --git a/cfg.mk b/cfg.mk index 2e7b68a..b6b2530 100644 --- a/cfg.mk +++ b/cfg.mk @@ -71,99 +71,96 @@ useless_free_options = \ # Avoid uses of write(2). Either switch to streams (fwrite), or use # the safewrite wrapper. sc_avoid_write: - @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - grep '\<write *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$') && \ - { echo "$(ME): the above files use write;" \ - " consider using the safewrite wrapper instead" \ - 1>&2; exit 1; } || :; \ - else :; \ - fi + @prohibit='\<write *\(' \ + in_vc_files='\.c$$' \ + halt='consider using safewrite instead of write' \ + $(_sc_search_regexp) # Use STREQ rather than comparing strcmp == 0, or != 0. # Similarly, use STREQLEN or STRPREFIX rather than strncmp. sc_prohibit_strcmp_and_strncmp: - @re='strn?cmp *\(' \ - msg='use STREQ() in place of the above uses of str[n]cmp' \ - $(_prohibit_regexp) + @prohibit='strn?cmp *\(' \ + halt='use STREQ() in place of the above uses of str[n]cmp' \ + $(_sc_search_regexp) # Use virAsprintf rather than a'sprintf since *strp is undefined on error. sc_prohibit_asprintf: - @re='\<[a]sprintf\>' \ - msg='use virAsprintf, not a'sprintf \ - $(_prohibit_regexp) + @prohibit='\<[a]sprintf\>' \ + halt='use virAsprintf, not a'sprintf \ + $(_sc_search_regexp) sc_prohibit_strncpy: - @re='strncpy *\(' \ - msg='use virStrncpy, not strncpy' \ - $(_prohibit_regexp) + @prohibit='strncpy *\(' \ + halt='use virStrncpy, not strncpy' \ + $(_sc_search_regexp) sc_prohibit_readlink: - @re='readlink *\(' \ - msg='use virFileResolveLink, not readlink' \ - $(_prohibit_regexp) + @prohibit='readlink *\(' \ + halt='use virFileResolveLink, not readlink' \ + $(_sc_search_regexp) sc_prohibit_gethostname: - @re='gethostname *\(' \ - msg='use virGetHostname, not gethostname' \ - $(_prohibit_regexp) + @prohibit='gethostname *\(' \ + halt='use virGetHostname, not gethostname' \ + $(_sc_search_regexp) sc_prohibit_gettext_noop: - @re='gettext_noop *\(' \ - msg='use N_, not gettext_noop' \ - $(_prohibit_regexp) + @prohibit='gettext_noop *\(' \ + halt='use N_, not gettext_noop' \ + $(_sc_search_regexp) sc_prohibit_VIR_ERR_NO_MEMORY: - @re='\<V''IR_ERR_NO_MEMORY\>' \ - msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \ - $(_prohibit_regexp) + @prohibit='\<V''IR_ERR_NO_MEMORY\>' \ + halt='use virReportOOMError, not V'IR_ERR_NO_MEMORY \ + $(_sc_search_regexp) +# Use a subshell for each function, to give the optimal warning message. include $(srcdir)/Makefile.nonreentrant sc_prohibit_nonreentrant: @fail=0 ; \ for i in $(NON_REENTRANT) ; \ do \ - grep --before 2 --after 1 -nE "\<$$i\>[:space:]*\(" $$($(VC_LIST_EXCEPT)) && \ - fail=1 && echo "$(ME): use $${i}_r, not $${i}" || : ; \ + (prohibit="\\<$$i *\\(" \ + halt="use $${i}_r, not $$i" \ + $(_sc_search_regexp) \ + ) || fail=1; \ done ; \ exit $$fail # Prohibit the inclusion of <ctype.h>. sc_prohibit_ctype_h: - @grep -E '^# *include *<ctype\.h>' $$($(VC_LIST_EXCEPT)) && \ - { echo "$(ME): don't use ctype.h; instead, use c-ctype.h" \ - 1>&2; exit 1; } || : + @prohibit='^# *include *<ctype\.h>' \ + halt="don't use ctype.h; instead, use c-ctype.h" \ + $(_sc_search_regexp) # Ensure that no C source file uses TABs for indentation. # Also match *.h.in files, to get libvirt.h.in. # Exclude files in gnulib, since they're imported. sc_TAB_in_indentation: - @grep -lE '^ * ' /dev/null \ - $$($(VC_LIST_EXCEPT) \ - | grep -E '\.(rng|[ch](\.in)?)$$' \ - | grep -v '^gnulib/') && \ - { echo '$(ME): found TAB(s) used for indentation in C sources;'\ - 'use spaces' 1>&2; exit 1; } || : + @prohibit='^ * ' \ + in_vc_files='\.(rng|[ch](\.in)?)$$' \ + halt='use spaces, not TAB, for indentation in C sources' \ + $(_sc_search_regexp) ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\ |isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper sc_avoid_ctype_macros: - @grep -E '\b($(ctype_re)) *\(' /dev/null \ - $$($(VC_LIST_EXCEPT)) && \ - { echo "$(ME): don't use ctype macros (use c-ctype.h)" \ - 1>&2; exit 1; } || : + @prohibit='\b($(ctype_re)) *\(' \ + halt="don't use ctype macros (use c-ctype.h)" \ + $(_sc_search_regexp) sc_prohibit_virBufferAdd_with_string_literal: - @re='\<virBufferAdd *\([^,]+, *"[^"]' \ - msg='use virBufferAddLit, not virBufferAdd, with a string literal' \ - $(_prohibit_regexp) + @prohibit='\<virBufferAdd *\([^,]+, *"[^"]' \ + halt='use virBufferAddLit, not virBufferAdd, with a string literal' \ + $(_sc_search_regexp) # Not only do they fail to deal well with ipv6, but the gethostby* # functions are also not thread-safe. sc_prohibit_gethostby: - @re='\<gethostby(addr|name2?) *\(' \ - msg='use getaddrinfo, not gethostby*' \ - $(_prohibit_regexp) + @prohibit='\<gethostby(addr|name2?) *\(' \ + halt='use getaddrinfo, not gethostby*' \ + $(_sc_search_regexp) # Many of the function names below came from this filter: # git grep -B2 '\<_('|grep -E '\.c- *[[:alpha:]_][[:alnum:]_]* ?\(.*[,;]$' \ @@ -239,7 +236,7 @@ func_re := ($(func_or)) # "%s", _("no storage vol w..." sc_libvirt_unmarked_diagnostics: @grep -nE \ - '\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \ + '\<$(func_re) \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \ | grep -v '_''(' && \ { echo '$(ME): found unmarked diagnostic(s)' 1>&2; \ exit 1; } || : @@ -272,22 +269,14 @@ sc_preprocessor_indentation: echo '$(ME): skipping test $@: cppi not installed' 1>&2; \ fi -_m1 = use "test C1 && test C2", not "test C1 -''a C2" -_m2 = use "test C1 || test C2", not "test C1 -''o C2" -# Using test's -a and -o operators is not portable. -sc_prohibit_test_minus_ao: - @re='(\<test| \[+) .+ -[ao] ' \ - msg='$(_m1); $(_m2)' \ - $(_prohibit_regexp) - sc_copyright_format: - @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright .*Red 'Hat \ - | grep -v Inc \ - && { echo '$(ME): Red Hat copyright is missing Inc' 1>&2; \ - exit 1; } || : - @$(VC_LIST_EXCEPT) | xargs grep -ni 'copyright [^(].*Red 'Hat \ - && { echo '$(ME): consistently use (C) in Red Hat copyright' 1>&2; \ - exit 1; } || : + @require='Copyright .*Red 'Hat', Inc\.' \ + containing='Copyright .*Red 'Hat \ + halt='Red Hat copyright is missing Inc.' \ + $(_sc_search_regexp) + @prohibit='Copyright [^(].*Red 'Hat \ + halt='consistently use (C) in Red Hat copyright' \ + $(_sc_search_regexp) # We don't use this feature of maint.mk. prev_version_file = /dev/null diff --git a/tests/object-locking.ml b/tests/object-locking.ml index 1fddd51..ce3b401 100644 --- a/tests/object-locking.ml +++ b/tests/object-locking.ml @@ -1,7 +1,7 @@ (* * Analyse libvirt driver API methods for mutex locking mistakes * - * Copyright (C) 2008-2010 Red Hat, Inc + * Copyright (C) 2008-2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index 72ed9e5..ee7b79d 100755 --- a/tools/virt-pki-validate.in +++ b/tools/virt-pki-validate.in @@ -297,7 +297,7 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright (C) 2006-2009 by Red Hat, Inc +Copyright (C) 2006-2010 by Red Hat, Inc. =head1 LICENSE diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in index a296c7f..54d045c 100644 --- a/tools/virt-xml-validate.in +++ b/tools/virt-xml-validate.in @@ -134,7 +134,7 @@ Alternatively report bugs to your software distributor / vendor. =head1 COPYRIGHT -Copyright (C) 2009 by Red Hat, Inc +Copyright (C) 2009-2010 by Red Hat, Inc. Copyright (C) 2009 by Daniel P. Berrange =head1 LICENSE -- 1.6.6.1

Eric Blake wrote:
A lot of syntax check rules have to be rewritten, but the result is easier to maintain. I tested each syntax rule by intentionally introducing a temporary violation of the rule. Additionally, some false positives for unmarked_diagnostics crept in, and an improved copyright_format test caught some bugs.
ACK, mainly on the basis of your thorough testing. The diffs look fine, too.

On 04/02/2010 10:49 AM, Jim Meyering wrote:
Eric Blake wrote:
A lot of syntax check rules have to be rewritten, but the result is easier to maintain. I tested each syntax rule by intentionally introducing a temporary violation of the rule. Additionally, some false positives for unmarked_diagnostics crept in, and an improved copyright_format test caught some bugs.
ACK, mainly on the basis of your thorough testing. The diffs look fine, too.
Thanks, pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Jim Meyering