From 7f64bc6544061ba534541a66ae4dab8c88a96a14 Mon Sep 17 00:00:00 2001 From: Raphaël Hertzog Date: Sun, 22 Nov 2009 16:34:11 +0100 Subject: dpkg-source: fail if several orig.tar files are available This concerns formats 2.0 and 3.0 (quilt) where the upstream tarball can be available with different compression schemes. We need precisely one file otherwise it doesn't know which one should be used and might pick the wrong one. --- scripts/Dpkg/Source/Package/V2.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/Dpkg/Source') diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm index e1874cb2d..6757795c3 100644 --- a/scripts/Dpkg/Source/Package/V2.pm +++ b/scripts/Dpkg/Source/Package/V2.pm @@ -248,6 +248,10 @@ sub do_build { my @origtarballs; foreach (sort $self->find_original_tarballs()) { if (/\.orig\.tar\.$comp_regex$/) { + if (defined($tarfile)) { + error(_g("several orig.tar files found (%s and %s) but only " . + "one is allowed"), $tarfile, $_); + } $tarfile = $_; push @origtarballs, $_; $self->add_file($_); -- cgit v1.2.3 From 6dbf501ff1c09aa3ef2ea09259b23322fa5bea02 Mon Sep 17 00:00:00 2001 From: Raphaël Hertzog Date: Tue, 24 Nov 2009 00:51:59 +0100 Subject: Dpkg::Source::Package::V3::quilt: set QUILT_PATCH_OPTS to mimick D::S::Patch When building "3.0 (quilt)" source packages, use QUILT_PATCH_OPTS="-t -F 0 -N -u -V never -g0" so that quilt is as strict as dpkg-source's internal implementation of quilt that relies on Dpkg::Source::Patch::apply(). --- debian/changelog | 3 +++ scripts/Dpkg/Source/Package/V3/quilt.pm | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts/Dpkg/Source') diff --git a/debian/changelog b/debian/changelog index 7b39dcc16..6c18471a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ dpkg (1.15.5.3) UNRELEASED; urgency=low to use. * Add missing "use Dpkg::Gettext" in Dpkg::Changelog::Entry::Debian. Closes: #557668 + * When building "3.0 (quilt)" source packages, use QUILT_PATCH_OPTS="-t -F 0 + -N -u -V never -g0" so that quilt is as strict as dpkg-source's internal + implementation of quilt. Closes: #557664 [ Guillem Jover ] * Verify that the alternative used in update-alternatives --set has been diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm index 2400c96fa..df68e06c1 100644 --- a/scripts/Dpkg/Source/Package/V3/quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/quilt.pm @@ -114,7 +114,10 @@ sub run_quilt { } my %opts = ( env => { QUILT_PATCHES => "$absdir/debian/patches", - QUILT_SERIES => $series }, + QUILT_SERIES => $series, + # Kept as close as possible to default patch options in + # Dpkg::Source::Patch (used in without_quilt mode) + QUILT_PATCH_OPTS => "-t -F 0 -N -u -V never -g0" }, 'chdir' => $dir, 'exec' => [ 'quilt', '--quiltrc', '/dev/null', @$params ], %more_opts @@ -169,7 +172,6 @@ sub apply_patches { $opts{"to_file"} = "/dev/null" if $skip_auto; info(_g("applying all patches with %s"), "quilt push -q " . $patches[-1]) unless $skip_auto; $self->run_quilt($dir, ['push', '-q', $patches[-1]], - delete_env => ['QUILT_PATCH_OPTS'], wait_child => 1, %opts); foreach my $patch (@patches) { foreach my $fn (keys %{$panalysis->{$patch}->{'filepatched'}}) { -- cgit v1.2.3 From e1b5e94395d10bf533015268beafb6604197632f Mon Sep 17 00:00:00 2001 From: Raphaël Hertzog Date: Tue, 24 Nov 2009 01:39:43 +0100 Subject: Dpkg::Source::Package::V3::quilt: check debian/patches{,series} before build Before accepting to build a 3.0 (quilt) source packages, ensure that debian/patches is a directory (or non-existing) and that debian/patches/series is a file (or non-existing). --- debian/changelog | 3 +++ scripts/Dpkg/Source/Package/V3/quilt.pm | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'scripts/Dpkg/Source') diff --git a/debian/changelog b/debian/changelog index 6c18471a8..66f8ece75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ dpkg (1.15.5.3) UNRELEASED; urgency=low * When building "3.0 (quilt)" source packages, use QUILT_PATCH_OPTS="-t -F 0 -N -u -V never -g0" so that quilt is as strict as dpkg-source's internal implementation of quilt. Closes: #557664 + * Before accepting to build a 3.0 (quilt) source packages, ensure that + debian/patches is a directory (or non-existing) and that + debian/patches/series is a file (or non-existing). Closes: #557618 [ Guillem Jover ] * Verify that the alternative used in update-alternatives --set has been diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm index df68e06c1..ca527c193 100644 --- a/scripts/Dpkg/Source/Package/V3/quilt.pm +++ b/scripts/Dpkg/Source/Package/V3/quilt.pm @@ -55,6 +55,24 @@ sub parse_cmdline_option { return 0; } +sub can_build { + my ($self, $dir) = @_; + my ($code, $msg) = $self->SUPER::can_build($dir); + return ($code, $msg) if $code eq 0; + my $pd = File::Spec->catdir($dir, "debian", "patches"); + if (-e $pd and not -d _) { + return (0, sprintf(_g("%s should be a directory or non-existing"), $pd)); + } + my $series_vendor = $self->get_series_file($dir); + my $series_main = File::Spec->catfile($pd, "series"); + foreach my $series ($series_vendor, $series_main) { + if (defined($series) and -e $series and not -f _) { + return (0, sprintf(_g("%s should be a file or non-existing"), $series)); + } + } + return (1, ""); +} + sub get_autopatch_name { my ($self) = @_; return "debian-changes-" . $self->{'fields'}{'Version'}; -- cgit v1.2.3