From: Raphael Hertzog Date: Sat, 7 Jun 2008 20:08:05 +0000 (+0200) Subject: dpkg-source: accept patches with missing context at the end X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=808ff71b8205aeb84cd8607c05fb5e906e78a401;p=dpkg dpkg-source: accept patches with missing context at the end * scripts/Dpkg/Source/Patch.pm (analyze): Accept unexpected end-of-file in patches if we're missing no more than 2 lines of context. Output a warning instead. --- diff --git a/ChangeLog b/ChangeLog index 7226c04a..59f5007b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-07 Raphael Hertzog + + * scripts/Dpkg/Source/Patch.pm (analyze): Accept unexpected + end-of-file in patches if we're missing no more than 2 lines + of context. Output a warning instead. + 2008-06-07 Raphael Hertzog * scripts/Dpkg/Source/Package/V3/quilt.pm (register_autopatch): diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm index 42484932..052389d1 100644 --- a/scripts/Dpkg/Source/Patch.pm +++ b/scripts/Dpkg/Source/Patch.pm @@ -368,7 +368,12 @@ sub analyze { # read hunk while ($olines || $nlines) { unless (defined($_ = getline($diff_handle))) { - error(_g("unexpected end of diff `%s'"), $diff); + if (($olines == $nlines) and ($olines < 3)) { + warning(_g("unexpected end of diff `%s'"), $diff); + last; + } else { + error(_g("unexpected end of diff `%s'"), $diff); + } } next if /^\\ No newline/; # Check stats