Explorar el Código

dpkg-source: parse correctly series files with patch options

* scripts/Dpkg/Source/Package/V3_0/quilt.pm: Parse correctly
series files with patch options and warn if something else than
-p1 is used.
* man/dpkg-source.1: Document how dpkg-source handles those patch
options in series files.
Raphael Hertzog hace 18 años
padre
commit
00aaaa9d86
Se han modificado 4 ficheros con 28 adiciones y 2 borrados
  1. 8 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 9 2
      man/dpkg-source.1
  4. 9 0
      scripts/Dpkg/Source/Package/V3_0/quilt.pm

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2008-04-25  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/Dpkg/Source/Package/V3_0/quilt.pm: Parse correctly
+	series files with patch options and warn if something else than
+	-p1 is used.
+	* man/dpkg-source.1: Document how dpkg-source handles those patch
+	options in series files.
+
 2008-04-25  Raphael Hertzog  <hertzog@debian.org>
 
 	* scripts/Dpkg/Source/Package/V3_0/native.pm: Fix permissions of

+ 2 - 0
debian/changelog

@@ -25,6 +25,8 @@ dpkg (1.14.19) UNRELEASED; urgency=low
     dpkg-iasearch has been kept as popcon still reports a few installations.
   * Collapsed multiple conflicts of dpkg with old versions of dpkg-dev
     in a single Conflicts: dpkg-dev (<< 1.14.16).
+  * The "3.0 (quilt)" source package format now parses correctly series files
+    with patch options and warn if something else than -p1 is used.
   
   [ Helge Kreutzmann ]
   * Minor fixes and clarifications to man pages.

+ 9 - 2
man/dpkg-source.1

@@ -353,8 +353,15 @@ All patches listed in \fBdebian/patches/debian.series\fP or
 \fBdebian/patches/series\fP are then applied.
 If the former file is used and the latter one doesn't exist (or is a
 symlink), then the latter is replaced with a symlink to the former. This
-is meant to simplify usage of quilt to manage the set of patches. The
-patches can remove files.
+is meant to simplify usage of quilt to manage the set of patches. Note
+however that while \fBdpkg\-source\fP parses correctly series files with
+explicit options used for patch application (stored on each line
+after the patch filename and one or more spaces), it does ignore those
+options and always expect patches that can be applied with the \fB-p1\fP
+option of \fBpatch\fP. It will thus emit a warning when it encounters
+such options, and the build is likely to fail.
+.PP
+Similarly to quilt's default behaviour, the patches can remove files too.
 .PP
 The file \fBdebian/patches/.dpkg-source-applied\fP is created if some
 patches have been applied during the extraction.

+ 9 - 0
scripts/Dpkg/Source/Package/V3_0/quilt.pm

@@ -77,6 +77,15 @@ sub get_patches {
             chomp; s/^\s+//; s/\s+$//; # Strip leading/trailing spaces
             s/\s#.*$//; # Strip trailing comment
             next unless $_;
+            if (/^(\S+)\s+(.*)$/) {
+                $_ = $1;
+                if ($2 ne '-p1') {
+                    warning(_g("the series file (%s) contains unsupported " .
+                               "options ('%s', line %s), dpkg-source might " .
+                               "fail when applying patches."),
+                            $series, $2, $.) unless $skip_auto;
+                }
+            }
             next if $skip_auto and $_ eq $auto_patch;
             push @patches, $_;
         }