summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2005-11-24 10:47:51 +0000
committerrillig <rillig>2005-11-24 10:47:51 +0000
commit76131c2f6900a5e5634951b5f7fc7c62829e9510 (patch)
treef06c5e6ac4fe449278f50c59370485d507ff6587
parent86ac6c563a1005b42cacd6dd5b4ed4cf14adf042 (diff)
downloadpkgsrc-76131c2f6900a5e5634951b5f7fc7c62829e9510.tar.gz
Bugfix.
- Removed the unused variable $opt_explain. It should really have been PkgLint::Logging::set_explain(). - In accordance to my personal idea of beauty, the --explain messages are indented as deep as the last diagnostics, and not by a single "\t".
-rw-r--r--pkgtools/pkglint/files/pkglint.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index d84dba16ad2..616232c3245 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -11,7 +11,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.383 2005/11/24 10:16:54 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.384 2005/11/24 10:47:51 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -131,6 +131,7 @@ my $verbosity = 0;
my $gcc_output_format = false;
my $explain_flag = false;
my $show_source_flag = false;
+my $indent = ""; # The width of the last diagnostics type.
sub log_message($$$$$) {
my ($out, $file, $lineno, $type, $message) = @_;
@@ -152,6 +153,7 @@ sub log_message($$$$$) {
if (!$gcc_output_format && defined($type)) {
$text .= "${sep}${type}:";
$sep = " ";
+ $indent = " " x length($type);
}
if (defined($file)) {
$text .= defined($lineno)
@@ -208,7 +210,7 @@ sub explain($$$) {
my ($file, $lines, $msg) = @_;
if ($explain_flag) {
- print STDOUT ("\t${msg}\n");
+ print STDOUT ("${indent} ${msg}\n");
}
}
@@ -667,7 +669,6 @@ my (%warnings) = (
my $opt_autofix = false;
my $opt_dumpmakefile = false;
-my $opt_explain = false;
my $opt_import = false;
my $opt_quiet = false;
my $opt_recursive = false;
@@ -699,7 +700,9 @@ my (@options) = (
parse_multioption($val, \%warnings);
} ],
[ "-e|--explain", "Explain the diagnostics or give further help",
- "explain|e", \$opt_explain ],
+ "explain|e", sub {
+ PkgLint::Logging::set_explain();
+ } ],
[ "-g|--gcc-output-format", "Mimic the gcc output format",
"gcc-output-format|g",
sub {