The following commit has been merged in the master branch:
commit 1b61b829a76ccbd7534aca962f442a0c80fb12f8
Author: Raphaël Hertzog <[email protected]>
Date:   Wed Nov 11 10:46:28 2009 +0100

    dpkg-source: list upstream files modified by the diff during extraction
    
    This only applies to "1.0" source packages using orig.tar.gz + diff.gz.
    
    Dpkg::Source::Patch::apply() is modified to return the hashref containing
    information about the patch applied so that we can extract the list of
    files in Dpkg::Source::Package::V1::do_extract()

diff --git a/debian/changelog b/debian/changelog
index a526330..76b8959 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -81,6 +81,8 @@ dpkg (1.15.5) UNRELEASED; urgency=low
   * Modify dpkg-source -b to use default build options from
     debian/source/options. Thus it's now possible to have sticky options, for
     example for the choice of a compression method (-Z<comp>).
+  * dpkg-source -x outputs the list of upstream files modified by the diff.gz
+    (applies only to source packages using format 1.0). Closes: #482166
 
   [ Updated dpkg translations ]
   * Czech (Miroslav Kure).
diff --git a/scripts/Dpkg/Source/Package/V1.pm 
b/scripts/Dpkg/Source/Package/V1.pm
index bf3f47a..17bd7ea 100644
--- a/scripts/Dpkg/Source/Package/V1.pm
+++ b/scripts/Dpkg/Source/Package/V1.pm
@@ -139,8 +139,12 @@ sub do_extract {
         my $patch = "$dscdir$difffile";
        info(_g("applying %s"), $difffile);
        my $patch_obj = Dpkg::Source::Patch->new(filename => $patch);
-       $patch_obj->apply($newdirectory, force_timestamp => 1,
-                          timestamp => time());
+       my $analysis = $patch_obj->apply($newdirectory, force_timestamp => 1,
+                                         timestamp => time());
+       my @files = grep { ! m{^[^/]+/debian/} }
+                   sort keys %{$analysis->{'filepatched'}};
+       info(_g("upstream files that have been modified: %s"),
+            "\n " . join("\n ", @files)) if scalar @files;
     }
 }
 
diff --git a/scripts/Dpkg/Source/Patch.pm b/scripts/Dpkg/Source/Patch.pm
index 5d4de0d..055080a 100644
--- a/scripts/Dpkg/Source/Patch.pm
+++ b/scripts/Dpkg/Source/Patch.pm
@@ -457,6 +457,7 @@ sub apply {
            unlink($fn) || syserr(_g("remove patch backup file %s"), $fn);
        }
     }
+    return $analysis;
 }
 
 # Verify if check will work...

-- 
dpkg's main repository


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

Reply via email to