diff options
author | rillig <rillig> | 2006-03-02 13:08:37 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-03-02 13:08:37 +0000 |
commit | 44fb211e7f2f66b882de5d83f95d658a6a614a5c (patch) | |
tree | 61998b93ac49b45f2e214c7c8a076b15ecb1b82e /pkgtools | |
parent | 35b09c5e2aeab85068e80b302c8a2d358617ccff (diff) | |
download | pkgsrc-44fb211e7f2f66b882de5d83f95d658a6a614a5c.tar.gz |
- It is an error if a hunk in a patch contains fewer lines that what is
specified in the hunk header.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 1fc7f19e6a4..b155a4fd71f 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.540 2006/03/02 10:37:43 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.541 2006/03/02 13:08:37 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -4327,10 +4327,16 @@ sub checkfile_patch($) { my $check_hunk_end = sub($$$) { my ($deldelta, $adddelta, $newstate) = @_; - if ($deldelta < 0 && $dellines == 0) { + if ($deldelta > 0 && $dellines == 0) { $redostate = $newstate; - } elsif ($adddelta < 0 && $addlines == 0) { + if (defined($addlines) && $addlines > 0) { + $line->log_error("Expected ${addlines} more lines to be added."); + } + } elsif ($adddelta > 0 && $addlines == 0) { $redostate = $newstate; + if (defined($dellines) && $dellines > 0) { + $line->log_error("Expected ${dellines} more lines to be deleted."); + } } else { if ($deldelta != 0) { $dellines -= $deldelta; |