Forráskód Böngészése

dpkg-source: list upstream files modified by the diff during build

This only applies to "1.0" source packages using orig.tar.gz + diff.gz.

In that case, it also recommends usage of the new format 3.0 (quilt)
to keep changes separate and documented.
Raphaël Hertzog 16 éve
szülő
commit
74f2648e4b
2 módosított fájl, 14 hozzáadás és 2 törlés
  1. 3 1
      debian/changelog
  2. 11 1
      scripts/Dpkg/Source/Package/V1.pm

+ 3 - 1
debian/changelog

@@ -81,8 +81,10 @@ 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
+  * dpkg-source outputs the list of upstream files modified by the diff.gz
     (applies only to source packages using format 1.0). Closes: #482166
+    It also recommends usage of 3.0 (quilt) format during dpkg-source -b if it
+    detects changes to upstream files that are stored in the .diff.gz.
 
   [ Updated dpkg translations ]
   * Czech (Miroslav Kure).

+ 11 - 1
scripts/Dpkg/Source/Package/V1.pm

@@ -1,4 +1,4 @@
-# Copyright © 2008 Raphaël Hertzog <hertzog@debian.org>
+# Copyright © 2008-2009 Raphaël Hertzog <hertzog@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -347,6 +347,16 @@ sub do_build {
         $diff->finish() || $ur++;
         pop @Dpkg::Exit::handlers;
 
+	my $analysis = $diff->analyze($origdir);
+	my @files = grep { ! m{^debian/} } map { s{^[^/]+/+}{}; $_ }
+		    sort keys %{$analysis->{'filepatched'}};
+	if (scalar @files) {
+	    warning(_g("the diff modifies the following upstream files: %s"),
+	            "\n " . join("\n ", @files));
+	    info(_g("use the '3.0 (quilt)' format to have separate and " .
+	            "documented changes to upstream files, see dpkg-source(1)"));
+	}
+
 	rename($newdiffgz, $diffname) ||
 	    syserr(_g("unable to rename `%s' (newly created) to `%s'"),
 	           $newdiffgz, $diffname);