From bda8d57b6af0bf3dfe2524514304856a16766b7d Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 11 Apr 2010 21:04:13 +0200 Subject: [PATCH] Prepend type to warning, error, and fatal messages. For the first part of messages of types `error' or `fatal', prepend `error: ' to the message. Prepend `warning: ' to warning messages, whatever the setting of -Werror. * lib/Automake/Channels.pm (partial): Move up definition. (_format_message): Emit `header' and `footer' strings only with the first resp. last part of a set of partial messages. * lib/Automake/ChannelDefs.pm: Add missing '1;' statement at the end of the module. (Automake::ChannelDefs): Setup warning channels with header `warning: ', error and fatal messages with header `error: '. * tests/condinc2.test, tests/ltinstloc.test: Adjust expected error messages. * tests/comment5.test: Likewise. Also, include stack notes should not start with `error:'. * tests/location.test: Likewise. Also, try both -Werror and -Wno-error. * NEWS: Update. Report by Bruno Haible. Signed-off-by: Ralf Wildenhues --- ChangeLog | 20 ++++++++++++++++++++ NEWS | 3 +++ lib/Automake/ChannelDefs.pm | 6 ++++++ lib/Automake/Channels.pm | 21 ++++++++++++--------- tests/comment5.test | 9 +++++---- tests/condinc2.test | 6 +++--- tests/location.test | 21 +++++++++++++-------- tests/ltinstloc.test | 6 +++--- 8 files changed, 65 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ed3c6f..65a637d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ 2010-04-11 Ralf Wildenhues + Prepend type to warning, error, and fatal messages. + For the first part of messages of types `error' or `fatal', + prepend `error: ' to the message. Prepend `warning: ' to + warning messages, whatever the setting of -Werror. + * lib/Automake/Channels.pm (partial): Move up definition. + (_format_message): Emit `header' and `footer' strings only with + the first resp. last part of a set of partial messages. + * lib/Automake/ChannelDefs.pm: Add missing '1;' statement at the + end of the module. + (Automake::ChannelDefs): Setup warning channels with header + `warning: ', error and fatal messages with header `error: '. + * tests/condinc2.test, tests/ltinstloc.test: Adjust expected + error messages. + * tests/comment5.test: Likewise. Also, include stack notes + should not start with `error:'. + * tests/location.test: Likewise. Also, try both -Werror and + -Wno-error. + * NEWS: Update. + Report by Bruno Haible. + Fix capitalization of error messages, reword one message. * lib/Automake/Variable.pm (define): Do not capitalize the first word in the error message. diff --git a/NEWS b/NEWS index 74887fb..5d167bb 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,9 @@ New in 1.11a: - "make dist" can now create lzip-compressed tarballs. + - Messages of types warning or error from `automake' and `aclocal' are now + prefixed with the respective type. + Bugs fixed in 1.11a: - Lots of minor bugfixes. diff --git a/lib/Automake/ChannelDefs.pm b/lib/Automake/ChannelDefs.pm index ce6bf29..26ef575 100644 --- a/lib/Automake/ChannelDefs.pm +++ b/lib/Automake/ChannelDefs.pm @@ -163,6 +163,10 @@ register_channel 'verb', type => 'debug', silent => 1, uniq_part => UP_NONE, ordered => 0; register_channel 'note', type => 'debug', silent => 0; +setup_channel_type 'warning', header => 'warning: '; +setup_channel_type 'error', header => 'error: '; +setup_channel_type 'fatal', header => 'error: '; + =head2 FUNCTIONS =over 4 @@ -381,6 +385,8 @@ Written by Alexandre Duret-Lutz EFE. =cut +1; + ### Setup "GNU" style for perl-mode and cperl-mode. ## Local Variables: ## perl-indent-level: 2 diff --git a/lib/Automake/Channels.pm b/lib/Automake/Channels.pm index 050ba05..b08b90d 100644 --- a/lib/Automake/Channels.pm +++ b/lib/Automake/Channels.pm @@ -204,10 +204,14 @@ C, and C constants above. =item C
''> A string to prepend to each message emitted through this channel. +With partial messages, only the first part will have C
+prepended. =item C