diff options
author | rillig <rillig@pkgsrc.org> | 2006-06-03 07:27:25 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2006-06-03 07:27:25 +0000 |
commit | 36aeee7541d2b8a14cbd1b57076990233901a2bd (patch) | |
tree | 70fc6e6dd7a3df59de946cd6f780aa7f77cf0a0e /pkgtools | |
parent | 6ee13c522ed193379b4b6ddb407ad72e8bfb69e8 (diff) | |
download | pkgsrc-36aeee7541d2b8a14cbd1b57076990233901a2bd.tar.gz |
Added an explanation for the warning that "Each sed command should
appear in an assignment of its own", since it had been misunderstood at
least once. Also, since the explanation is usually several lines long,
it does not hurt to add two extra empty lines to separate the
explanation from the actual warning.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 0977773a5eb..ddcdd6d626b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.600 2006/06/03 07:06:23 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.601 2006/06/03 07:27:25 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -279,7 +279,7 @@ sub explain($$@) { my $out = ($loglevel == LL_FATAL) ? *STDERR : *STDOUT; if ($explain_flag) { - foreach my $text (@texts) { + foreach my $text ("", @texts, "") { print $out ("\t${text}\n"); } } @@ -3950,6 +3950,14 @@ sub checkline_mk_vartype_basic($$$$$$$) { $ncommands++; if ($ncommands > 1) { $line->log_warning("Each sed command should appear in an assignment of its own."); + $line->explain_warning( + "For example, instead of", + " SUBST_SED.foo+= -e s,command1,, -e s,command2,,", + "use", + " SUBST_SED.foo+= -e s,command1,,", + " SUBST_SED.foo+= -e s,command2,,", + "", + "This way, short sed commands cannot be hidden at the end of a line."); } checkline_mk_shellword($line, $word, true); } else { |