diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | scripts/Dpkg/Source/Package/V3/quilt.pm | 26 |
2 files changed, 25 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog index fdb069a41..0c15a651f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,9 @@ dpkg (1.15.6) UNRELEASED; urgency=low * Accept filename with spaces and colon in the output of objdump. Required so that dpkg-shlibdeps support such files properly. Thanks to Raphaƫl Geissert for the patch. Closes: #565712 + * When unpacking a "3.0 (quilt)" source package, tell quilt where + patches are (to be) stored. Requires quilt >= 0.48-5 to work. + Closes: #557619 [ Guillem Jover ] * Handle argument parsing in dpkg-checkbuilddeps and dpkg-scanpackages diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm index dfa3a08ec..7b8412ff7 100644 --- a/scripts/Dpkg/Source/Package/V3/quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/quilt.pm @@ -133,12 +133,27 @@ sub create_quilt_db { if (not -d $db_dir) { mkdir $db_dir or syserr(_g("cannot mkdir %s"), $db_dir); } - my $version_file = File::Spec->catfile($db_dir, ".version"); - if (not -e $version_file) { - open(VERSION, ">", $version_file); + my $file = File::Spec->catfile($db_dir, ".version"); + if (not -e $file) { + open(VERSION, ">", $file) or syserr(_g("cannot write %s"), $file); print VERSION "2\n"; close(VERSION); } + # The files below are used by quilt to know where patches are stored + # and what file contains the patch list (supported by quilt >= 0.48-5 + # in Debian). + $file = File::Spec->catfile($db_dir, ".quilt_patches"); + if (not -e $file) { + open(QPATCH, ">", $file) or syserr(_g("cannot write %s"), $file); + print QPATCH "debian/patches\n"; + close(QPATCH); + } + $file = File::Spec->catfile($db_dir, ".quilt_series"); + if (not -e $file) { + open(QSERIES, ">", $file) or syserr(_g("cannot write %s"), $file); + print QSERIES "series\n"; + close(QSERIES); + } } sub apply_quilt_patch { @@ -174,6 +189,10 @@ sub apply_patches { my $patches = $opts{"patches"}; + # Always create the quilt db so that if the maintainer calls quilt to + # create a patch, it's stored in the right directory + $self->create_quilt_db($dir); + # Update debian/patches/series symlink if needed to allow quilt usage my $series = $self->get_series_file($dir); return unless $series; # No series, no patches @@ -193,7 +212,6 @@ sub apply_patches { return unless scalar(@$patches); # Apply patches - $self->create_quilt_db($dir); my $pc_applied = File::Spec->catfile($dir, ".pc", "applied-patches"); my @applied = $self->read_patch_list($pc_applied); my @patches = $self->read_patch_list($self->get_series_file($dir)); |