[virt-tools-list] [virt-viewer][PATCH 1/3] cfg.mk: Don't require bindtextdomain directly

Eric Blake eblake at redhat.com
Tue Nov 13 15:30:02 UTC 2012


[adding gnulib]

On 11/13/2012 04:28 AM, Michal Privoznik wrote:
> With current implementation, all binaries that need it call
> bindtextdomain but not directly. They call a helper function
> instead.  This makes, however, syntax-check fail as it cannot
> recognize it.
> ---
>  cfg.mk |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/cfg.mk b/cfg.mk
> index 3f9b47b..c2e9644 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -133,5 +133,6 @@ exclude_file_name_regexp--sc_require_config_h_first = ^plugin/|src/gbinding\.c|s
>  exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^icons/
>  exclude_file_name_regexp--sc_trailing_blank = ^icons/
>  
> -exclude_file_name_regexp--sc_bindtextdomain = src/windows-cmdline-wrapper.c
>  exclude_file_name_regexp--sc_prohibit_magic_number_exit = src/windows-cmdline-wrapper.c
> +
> +exclude_file_name_regexp--sc_bindtextdomain = ^src/(debug-helper.c|remote-viewer-main.c|virt-viewer-main.c|windows-cmdline-wrapper.c)$$

Rather than excluding every file, it may be easier to just disable the
rule as inapplicable to this package:

diff --git i/cfg.mk w/cfg.mk
index 3f9b47b..c395b80 100644
--- i/cfg.mk
+++ w/cfg.mk
@@ -1,5 +1,5 @@
 # Customize Makefile.maint.                           -*- makefile -*-
-# Copyright (C) 2008-2011 Red Hat, Inc.
+# Copyright (C) 2008-2012 Red Hat, Inc.
 # Copyright (C) 2003-2008 Free Software Foundation, Inc.

 # This program is free software: you can redistribute it and/or modify
@@ -24,6 +24,7 @@ local-checks-to-skip =			\
   patch-check				\
   sc_GPL_version			\
   sc_always_defined_macros		\
+  sc_bindtextdomain			\
   sc_cast_of_alloca_return_value	\
   sc_cross_check_PATH_usage_in_tests	\
   sc_dd_max_sym_length			\



Or, you could even rewrite the maint.mk version into something more
applicable (untested):

diff --git i/cfg.mk w/cfg.mk
index 3f9b47b..50f096c 100644
--- i/cfg.mk
+++ w/cfg.mk
@@ -1,5 +1,5 @@
 # Customize Makefile.maint.                           -*- makefile -*-
-# Copyright (C) 2008-2011 Red Hat, Inc.
+# Copyright (C) 2008-2012 Red Hat, Inc.
 # Copyright (C) 2003-2008 Free Software Foundation, Inc.

 # This program is free software: you can redistribute it and/or modify
@@ -24,6 +24,7 @@ local-checks-to-skip =			\
   patch-check				\
   sc_GPL_version			\
   sc_always_defined_macros		\
+  sc_bindtextdomain			\
   sc_cast_of_alloca_return_value	\
   sc_cross_check_PATH_usage_in_tests	\
   sc_dd_max_sym_length			\
@@ -107,6 +108,16 @@ sc_copyright_format:
 	halt='spell Red Hat as two words'				\
 	  $(_sc_search_regexp)

+# Ensure that each .c file containing a "main" function also
+# calls bindtextdomain via virt_viewer_util_init.
+sc_util_init:
+	@require='virt_viewer_util_init *\('				\
+	in_vc_files='\.c$$'						\
+	containing='\<main *('						\
+	halt='the above files do not call virt_viewer_util_init'	\
+	  $(_sc_search_regexp)
+
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null




Or, we could alter gnulib maint.mk to let functions override the name of
the required function to call in all files with a main(); defaulting to
bindtextdomain, but in virt-viewer's case, using virt_viewer_util_init
instead.

-- 
Eric Blake   eblake at 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: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20121113/6b34c934/attachment.sig>


More information about the virt-tools-list mailing list