diff options
author | rillig <rillig@pkgsrc.org> | 2005-08-06 22:24:07 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-08-06 22:24:07 +0000 |
commit | 810752a20e21035c32637f9208e989159c16ed02 (patch) | |
tree | 0845efa25aadbee83d256cdc2977df56e67b491e /pkgtools | |
parent | 49fa8bb914a1e387b03dc6db0d43878dae8f3af2 (diff) | |
download | pkgsrc-810752a20e21035c32637f9208e989159c16ed02.tar.gz |
Fixed the indentation. Replaced a nested if with an &&. Noticed that I
had put the closing indentation FIXME comment at a wrong place. But as
it is removed now, this doesn't matter.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index bd04db3fb08..58b927bd20c 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.233 2005/08/06 22:20:10 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.234 2005/08/06 22:24:07 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -2090,33 +2090,29 @@ sub check_category($) { if (!$lines_atend && $fetch_next_line) { $fetch_next_line = false; -# FIXME: <indent +1> - if ($line->text =~ qr"^(#?)SUBDIR\+=(\s*)(\S+)\s*(?:#\s*(.*?)\s*|)$") { - my ($comment_flag, $indentation, $subdir, $comment) = ($1, $2, $3, $4); + if ($line->text =~ qr"^(#?)SUBDIR\+=(\s*)(\S+)\s*(?:#\s*(.*?)\s*|)$") { + my ($comment_flag, $indentation, $subdir, $comment) = ($1, $2, $3, $4); - if ($comment_flag eq "#") { - if (!defined($comment) || $comment eq "") { + if ($comment_flag eq "#" && (!defined($comment) || $comment eq "")) { $line->log_error("${subdir} commented out without giving a reason."); } - } - if ($indentation ne "\t") { - $line->log_error("Indentation must be a single tab character."); - } + if ($indentation ne "\t") { + $line->log_error("Indentation must be a single tab character."); + } - if (defined($last_subdir) && $subdir le $last_subdir) { - $line->log_error("${subdir} must come before ${last_subdir}."); - } - $last_subdir = $subdir; + if (defined($last_subdir) && $subdir le $last_subdir) { + $line->log_error("${subdir} must come before ${last_subdir}."); + } + $last_subdir = $subdir; - } elsif ($is_wip && $line->text eq "") { - # ignore the special case "wip", which defines its own "index" target. - $lines_atend = true; + } elsif ($is_wip && $line->text eq "") { + # ignore the special case "wip", which defines its own "index" target. + $lines_atend = true; - } else { - $line->log_error("SUBDIR+= line expected."); - } -# FIXME: </indent> + } else { + $line->log_error("SUBDIR+= line expected."); + } $lines_index++; } |