summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-02-10 12:47:23 +0000
committerPádraig Brady <P@draigBrady.com>2013-02-10 20:30:53 +0000
commit3309e880fb2b5d4316809c5ceef4f5b2b8d34a38 (patch)
tree7f55499b883b230b4a8d550e2d340befe2d82e4e /cfg.mk
parent71ab11eac1de965e90abf050bf1bbe22eb4ac7b9 (diff)
downloadcoreutils-3309e880fb2b5d4316809c5ceef4f5b2b8d34a38.tar.xz
maint: consolidate developer debug messages
Both factor and numfmt recently introduced debug messages for developers, enabled by --verbose and ---devdebug respectively. There were a few issues though: 1. They used different mechanisms to enable these messages. 2. factor used --verbose which might be needed for something else 3. They used different methods to output the messages, and numfmt used error() which added an unwanted newline 4. numfmt marked all these messages for translation and factor marked a couple. We really don't need these translated. So we fix the above issues here while renaming the enabling option for both commands to ---debug (still undocumented). * src/factor.c (verbose): Rename to dev_debug and change from int to bool as it's just a toggle flag. (long_options): Rename --verbose to ---debug. * src/system.h (devmsg): A new inline function to output a message if enabled by a global dev_debug variable in the compilation unit. * src/numfmt.c: Use devmsg() rather than error(). Also remove the translation tags from these messages. Also change debug flag to bool from int. * tests/misc/numfmt.pl: Adjust for the ---devdebug to ---debug change. * cfg.mk (sc_marked_devdiagnostics): Add a syntax check to ensure translations are not added to devmsg calls. Reported by Göran Uddeborg in http://bugs.gnu.org/13665
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index fbc64b4af..77356ab13 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -521,6 +521,13 @@ sc_THANKS_in_duplicates:
&& { echo '$(ME): remove the above names from THANKS.in' \
1>&2; exit 1; } || :
+# Look for developer diagnostics that are marked for translation.
+# This won't find any for which devmsg's format string is on a separate line.
+sc_marked_devdiagnostics:
+ @prohibit='\<devmsg *\(.*_\(' \
+ halt='found marked developer diagnostic(s)' \
+ $(_sc_search_regexp)
+
# Override the default Cc: used in generating an announcement.
announcement_Cc_ = $(translation_project_), \
coreutils@gnu.org, coreutils-announce@gnu.org