]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
maint: enforce no-markup policy wrt VIR_WARN-like macros
authorJim Meyering <meyering@redhat.com>
Wed, 19 May 2010 10:51:11 +0000 (12:51 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 19 May 2010 10:52:47 +0000 (12:52 +0200)
* cfg.mk (sc_prohibit_gettext_markup): New rule, to enforce
this policy.  Contrary to most diagnostic-emitting functions,
where we require _(...) markup, here, we require that _() *not*
be used for certain functions (or function-like macros).

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 96d6953db863d8831411a3b9408438e090610e0d..04719d434c312d0c1818799fa63ee72880f39c3a 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -228,7 +228,7 @@ sc_avoid_write:
        @prohibit='\<write *\('                                         \
        in_vc_files='\.c$$'                                             \
        halt='consider using safewrite instead of write'                \
-        $(_sc_search_regexp)
+         $(_sc_search_regexp)
 
 # Use STREQ rather than comparing strcmp == 0, or != 0.
 # Similarly, use STREQLEN or STRPREFIX rather than strncmp.
@@ -285,7 +285,7 @@ sc_prohibit_nonreentrant:
 sc_prohibit_ctype_h:
        @prohibit='^# *include  *<ctype\.h>'                            \
        halt="don't use ctype.h; instead, use c-ctype.h"                \
-        $(_sc_search_regexp)
+         $(_sc_search_regexp)
 
 # Ensure that no C source file or rng schema uses TABs for
 # indentation.  Also match *.h.in files, to get libvirt.h.in.  Exclude
@@ -294,7 +294,7 @@ sc_TAB_in_indentation:
        @prohibit='^ *  '                                               \
        in_vc_files='(\.(rng|[ch](\.in)?)|(daemon|tools)/.*\.in)$$'     \
        halt='use spaces, not TAB, for indentation in C, sh, and RNG schemas' \
-        $(_sc_search_regexp)
+         $(_sc_search_regexp)
 
 ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
 |isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
@@ -302,7 +302,7 @@ ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
 sc_avoid_ctype_macros:
        @prohibit='\b($(ctype_re)) *\('                                 \
        halt="don't use ctype macros (use c-ctype.h)"                   \
-        $(_sc_search_regexp)
+         $(_sc_search_regexp)
 
 sc_prohibit_virBufferAdd_with_string_literal:
        @prohibit='\<virBufferAdd *\([^,]+, *"[^"]'                     \
@@ -415,10 +415,17 @@ sc_copyright_format:
        @require='Copyright .*Red 'Hat', Inc\.'                         \
        containing='Copyright .*Red 'Hat                                \
        halt='Red Hat copyright is missing Inc.'                        \
-        $(_sc_search_regexp)
+         $(_sc_search_regexp)
        @prohibit='Copyright [^(].*Red 'Hat                             \
        halt='consistently use (C) in Red Hat copyright'                \
-        $(_sc_search_regexp)
+         $(_sc_search_regexp)
+
+# Some functions/macros produce messages intended solely for developers
+# and maintainers.  Do not mark them for translation.
+sc_prohibit_gettext_markup:
+       @prohibit='\<VIR_WARN0? *\(_\('                                 \
+       halt='do not mark these strings for translation'                \
+         $(_sc_search_regexp)
 
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null