]> err.no Git - dpkg/commitdiff
dpkg-source: accept patches with missing context at the end
authorRaphael Hertzog <hertzog@debian.org>
Sat, 7 Jun 2008 20:08:05 +0000 (22:08 +0200)
committerRaphael Hertzog <hertzog@debian.org>
Sat, 7 Jun 2008 20:08:25 +0000 (22:08 +0200)
* 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.

ChangeLog
scripts/Dpkg/Source/Patch.pm

index 7226c04a145e6f4824a5fe36f744178d401fe9b6..59f5007be287a7830a5a971dfe3e2fdbcf807373 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-07  Raphael Hertzog  <hertzog@debian.org>
+
+       * 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  <hertzog@debian.org>
 
        * scripts/Dpkg/Source/Package/V3/quilt.pm (register_autopatch):
index 42484932b6ec389dee3663fd4350b942a1fb9057..052389d13ccb3114d65536bfb74ed7786b34c739 100644 (file)
@@ -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