diff options
author | rillig <rillig@pkgsrc.org> | 2005-09-01 22:45:16 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2005-09-01 22:45:16 +0000 |
commit | 772fe054705ef8e808a831f0151b8bc9152fa9c6 (patch) | |
tree | 4e03651cc69d0c45fc58a8c886218bf96c6d3771 /pkgtools | |
parent | fddefa43385d7df338a01913ded12242d875d7e2 (diff) | |
download | pkgsrc-772fe054705ef8e808a831f0151b8bc9152fa9c6.tar.gz |
Fixed the false warnings for lines in patches that start with "---". The
old parser had been a little too simple.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 98f10355dad..dee4ffa94bc 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.262 2005/09/01 22:09:39 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.263 2005/09/01 22:45:16 rillig Exp $ # # This version contains lots of changes necessary for NetBSD packages # done by: @@ -954,14 +954,18 @@ sub checkfile_extra($$) { # $lines => an array of lines as returned by load_file(). sub check_for_multiple_patches($) { my ($lines) = @_; - my ($files_in_patch, $patch_state, $line_type); + my ($files_in_patch, $patch_state, $line_type, $dellines); $files_in_patch = 0; $patch_state = ""; + $dellines = 0; foreach my $line (@{$lines}) { my $text = $line->text; - if (index($text, "--- ") == 0 && $text !~ qr"^--- \d+(?:,\d+|) ----$") { + if ($text =~ qr"^@@ -\d+,(\d+) \+\d+,\d+ @@") { + $dellines = $1; + + } elsif ($dellines == 0 && index($text, "--- ") == 0 && $text !~ qr"^--- \d+(?:,\d+|) ----$") { $line_type = "-"; } elsif (index($text, "*** ") == 0 && $text !~ qr"^\*\*\* \d+(?:,\d+|) \*\*\*\*$") { @@ -971,6 +975,9 @@ sub check_for_multiple_patches($) { } elsif (index($text, "+++ ") == 0) { $line_type = "+"; + } elsif ($dellines > 0 && $text =~ qr"^(?:-|\s)") { + $dellines--; + } else { $line_type = ""; } |