summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Source/Package/V3/quilt.pm
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2010-01-23 23:25:45 +0100
committerRaphaël Hertzog <hertzog@debian.org>2010-01-23 23:57:21 +0100
commitbf8ff0cd3dd88a06c2a3cfca8d6439df5fa217cb (patch)
tree20b7265888de5f119f0a331b1bc785debdc94050 /scripts/Dpkg/Source/Package/V3/quilt.pm
parent8e00bfcbc75213c00a6b782ffed332ba5b772aef (diff)
downloaddpkg-bf8ff0cd3dd88a06c2a3cfca8d6439df5fa217cb.tar.gz
dpkg-source: unpacking a 3.0 (quilt) source package configures quilt accordingly
The files .pc/.quilt_patches and .pc/.quilt_series are always created so that any quilt invocation will know where to look for (or where to store) patches. This will only work with quilt >= 0.48-5.
Diffstat (limited to 'scripts/Dpkg/Source/Package/V3/quilt.pm')
-rw-r--r--scripts/Dpkg/Source/Package/V3/quilt.pm26
1 files changed, 22 insertions, 4 deletions
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));