Package: dpkg
Version: 1.14.25a0.mrvn.2
Severity: important
Tags: patch

Hi,

when using 3.0 (quilt) format with quilt dpkg-source will
automatically generate debian/patches/debian-changes-version and
import the patch into quilt. If one then eddits a new file (one not
already in debian-changes-version) and reruns dpkg-source then a new
debian-changes-version patch will be generated but quilt is not told
about it. A quilt pop will then not revert the new file and a quilt
push will fail to apply the patch (again).

The attached patch makes quilt aware of the updated
debian-changes-version patch.

MfG
        Goswin

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (400, 'unstable-i386'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-xen-1 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg depends on:
ii  coreutils                     7.1-2      The GNU core utilities
ii  libc6                         2.9-6      GNU C Library: Shared libraries
ii  lzma                          4.43-14    Compression method of 7z format in

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                           0.7.20.2   Advanced front-end for dpkg

-- no debconf information
diff -Nru dpkg-1.14.25a0.mrvn.1/scripts/Dpkg/Source/Package/V3/quilt.pm dpkg-1.14.25a0.mrvn.2/scripts/Dpkg/Source/Package/V3/quilt.pm
--- dpkg-1.14.25a0.mrvn.1/scripts/Dpkg/Source/Package/V3/quilt.pm	2009-02-01 07:19:01.000000000 +0100
+++ dpkg-1.14.25a0.mrvn.2/scripts/Dpkg/Source/Package/V3/quilt.pm	2009-04-27 16:09:04.000000000 +0200
@@ -254,7 +254,19 @@
             open(APPLIED, ">>", $applied) || syserr(_g("cannot write %s"), $applied);
             print APPLIED "$auto_patch\n";
             close(APPLIED);
-        }
+        } else {
+	    # If quilt was used tell it about the new patch
+	    if (-d "$dir/.pc" and not $self->{'options'}{'without_quilt'})
+            {
+	        # Updating the patch with quilt requires some
+	        # trickery: reverse-apply the patch, force pop it with
+	        # quilt, apply it agian with quilt
+                my $patch_obj = Dpkg::Source::Patch->new(filename => $patch);
+                $patch_obj->apply($dir, add_options => ['-R', '-E']);
+                $self->run_quilt($dir, ['pop', '-f'], wait_child => 1, to_file => '/dev/null');
+                $self->run_quilt($dir, ['push'], wait_child => 1, to_file => '/dev/null');
+	    }
+	}
     } else {
         # Remove auto_patch from series
         if ($has_patch) {

Reply via email to