From 73da543e77a78f57867c95a44c09f1a132f3cbd1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 29 Jan 2009 18:06:19 +0000 Subject: [PATCH] maint: sync from coreutils * .x-sc_prohibit_have_config_h: Renamed from... * .x-sc_no_have_config_h: ... this. * .x-sc_prohibit_HAVE_MBRTOWC: New file. --- .x-sc_prohibit_HAVE_MBRTOWC | 1 + ...e_config_h => .x-sc_prohibit_have_config_h | 0 ChangeLog | 7 ++ Makefile.maint | 77 ++++++++++++++----- 4 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 .x-sc_prohibit_HAVE_MBRTOWC rename .x-sc_no_have_config_h => .x-sc_prohibit_have_config_h (100%) diff --git a/.x-sc_prohibit_HAVE_MBRTOWC b/.x-sc_prohibit_HAVE_MBRTOWC new file mode 100644 index 0000000000..36775da17d --- /dev/null +++ b/.x-sc_prohibit_HAVE_MBRTOWC @@ -0,0 +1 @@ +gnulib/.* diff --git a/.x-sc_no_have_config_h b/.x-sc_prohibit_have_config_h similarity index 100% rename from .x-sc_no_have_config_h rename to .x-sc_prohibit_have_config_h diff --git a/ChangeLog b/ChangeLog index 7b75836375..b85d35a854 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jan 29 19:05:00 +0100 2009 Jim Meyering + + maint: sync from coreutils + * .x-sc_prohibit_have_config_h: Renamed from... + * .x-sc_no_have_config_h: ... this. + * .x-sc_prohibit_HAVE_MBRTOWC: New file. + Thu Jan 29 17:40:22 GMT 2009 Daniel P. Berrange Support VNC password setting for QEMU driver diff --git a/Makefile.maint b/Makefile.maint index ce062e8c3e..d257a8014b 100644 --- a/Makefile.maint +++ b/Makefile.maint @@ -29,6 +29,11 @@ local-checks-available = \ makefile-check check-AUTHORS .PHONY: $(local-checks-available) +# Arrange to print the name of each syntax-checking rule just before running it. +$(syntax-check-rules): %: %.m +$(patsubst %, %.m, $(syntax-check-rules)): + @echo $(patsubst sc_%.m, %, $@) + local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available)) syntax-check: $(local-check) @@ -43,6 +48,10 @@ syntax-check: $(local-check) # exit 1; } || : # FIXME: don't allow `#include .strings\.h' anywhere +# By default, _prohibit_regexp does not ignore case. +export ignore_case = +_ignore_case = $$(test -n "$$ignore_case" && echo -i || :) + # There are many rules below that prohibit constructs in this package. # If the offending construct can be matched with a grep-E-style regexp, # use this macro. The shell variables "re" and "msg" must be defined. @@ -50,7 +59,7 @@ define _prohibit_regexp dummy=; : so we do not need a semicolon before each use \ test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; }; \ test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\ - grep -nE "$$re" $$($(VC_LIST_EXCEPT)) && \ + grep $(_ignore_case) -nE "$$re" $$($(VC_LIST_EXCEPT)) && \ { echo '$(ME): '"$$msg" 1>&2; exit 1; } || : endef @@ -135,13 +144,12 @@ sc_error_exit_success: exit 1; } || : sc_file_system: - @grep -ni 'file''system' $$($(VC_LIST_EXCEPT)) && \ - { echo '$(ME): found use of "file''system";' \ - 'rewrite to use "file system"' 1>&2; \ - exit 1; } || : + @re=file''system ignore_case=1 \ + msg='found use of "file''system"; spell it "file system"' \ + $(_prohibit_regexp) # Don't use cpp tests of this symbol. All code assumes config.h is included. -sc_no_have_config_h: +sc_prohibit_have_config_h: @grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \ { echo '$(ME): found use of HAVE''_CONFIG_H; remove' \ 1>&2; exit 1; } || : @@ -172,6 +180,10 @@ sc_require_config_h_first: else :; \ fi +sc_prohibit_HAVE_MBRTOWC: + @re='\bHAVE_MBRTOWC\b' msg="do not use $$re; it is always defined" \ + $(_prohibit_regexp) + # To use this "command" macro, you must first define two shell variables: # h: the header, enclosed in <> or "" # re: a regular expression that matches IFF something provided by $h is used. @@ -203,6 +215,36 @@ sc_prohibit_quotearg_without_use: sc_prohibit_quote_without_use: @h='"quote.h"' re='\&2; exit 1; } || : sc_obsolete_symbols: - @grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \ - $$($(VC_LIST_EXCEPT)) && \ - { echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \ - 1>&2; exit 1; } || : + @re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \ + msg='do not use HAVE''_FCNTL_H or O'_NDELAY \ + $(_prohibit_regexp) # FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ @@ -232,14 +273,14 @@ sc_changelog: exit 1; } || : sc_the_the: - @grep -ni '\' $$($(VC_LIST_EXCEPT)) && \ - { echo '$(ME): found use of "the ''the";' 1>&2; \ - exit 1; } || : + @re='\' \ + ignore_case=1 msg='found use of "the ''the";' \ + $(_prohibit_regexp) sc_trailing_blank: - @grep -n '[ ]$$' $$($(VC_LIST_EXCEPT)) && \ - { echo '$(ME): found trailing blank(s)' \ - 1>&2; exit 1; } || : + @re='[ ]$$' \ + ignore_case=1 msg='found trailing blank(s)' \ + $(_prohibit_regexp) # Ensure that no C source file uses TABs for indentation. # Also match *.h.in files, to get libvirt.h.in. @@ -375,8 +416,8 @@ sc_useless_cpp_parens: # Require the latest GPL. sc_GPL_version: - @grep -n 'either ''version [^3]' $$($(VC_LIST_EXCEPT)) && \ - { echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || : + @re='either ''version [^3]' msg='GPL vN, N!=3' \ + $(_prohibit_regexp) cvs_keywords = \ Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State