The following commit has been merged in the master branch:
commit 0898ea0048fd94349f4bcf0068b22104d97217e3
Author: Raphaël Hertzog <[email protected]>
Date:   Sun Feb 21 01:04:02 2010 +0100

    Dpkg::Source: fix parsing of diff's output to be POSIX-compliant
    
    While parsing diff's output, accept any sentence that contains the word
    differ (as specified by POSIX) to identify that binary files could
    not be compared.

diff --git a/debian/changelog b/debian/changelog
index 4abb401..c62b435 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low
     and the patch. Closes: #569618
   * Add $VERSION numbers to all perl modules. Closes: #465256
     1.00 and higher means that the API should be stable
+  * While parsing diff's output, accept any sentence that contains the word
+    differ (as specified by POSIX) to identify that binary files could not be
+    compared. Closes: #570008
 
   [ Guillem Jover ]
   * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages
diff --git a/scripts/Dpkg/Source/Functions.pm b/scripts/Dpkg/Source/Functions.pm
index f4a06f6..8588ed6 100644
--- a/scripts/Dpkg/Source/Functions.pm
+++ b/scripts/Dpkg/Source/Functions.pm
@@ -67,6 +67,9 @@ sub fixperms {
 sub is_binary($) {
     my ($file) = @_;
 
+    # TODO: might want to reimplement what diff does, aka checking if the
+    # file contains \0 in the first 4Kb of data
+
     # Use diff to check if it's a binary file
     my $diffgen;
     my $diff_pid = spawn(
@@ -76,7 +79,7 @@ sub is_binary($) {
     );
     my $result = 0;
     while (<$diffgen>) {
-        if (m/^binary/i) {
+        if (m/^(?:binary|[^-+\@ ].*\bdiffer\b)/i) {
             $result = 1;
             last;
         } elsif (m/^[-+\@ ]/) {
diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm
index 45840bc..18130ec 100644
--- a/scripts/Dpkg/Source/Patch.pm
+++ b/scripts/Dpkg/Source/Patch.pm
@@ -107,7 +107,7 @@ sub add_diff_file {
     my $difflinefound = 0;
     my $binary = 0;
     while (<$diffgen>) {
-        if (m/^binary/i) {
+        if (m/^(?:binary|[^-+\@ ].*\bdiffer\b)/i) {
             $binary = 1;
             &$handle_binary($self, $old, $new);
             last;

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to