summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Source/Package
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Dpkg/Source/Package')
-rw-r--r--scripts/Dpkg/Source/Package/V2.pm4
-rw-r--r--scripts/Dpkg/Source/Package/V3/quilt.pm24
2 files changed, 26 insertions, 2 deletions
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($_);
diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm b/scripts/Dpkg/Source/Package/V3/quilt.pm
index 2400c96fa..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'};
@@ -114,7 +132,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 +190,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'}}) {