Sfoglia il codice sorgente

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()
Raphaël Hertzog 16 anni fa
parent
commit
1b61b829a7
3 ha cambiato i file con 9 aggiunte e 2 eliminazioni
  1. 2 0
      debian/changelog
  2. 6 2
      scripts/Dpkg/Source/Package/V1.pm
  3. 1 0
      scripts/Dpkg/Source/Patch.pm

+ 2 - 0
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).

+ 6 - 2
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;
     }
 }
 

+ 1 - 0
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...