+2008-05-08 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/Dpkg/Source/Package/V2.pm,
+ scripts/Dpkg/Source/Package/V3/quilt.pm: Ensure the
+ .dpkg-source-applied stamp file is created when an automatic patch
+ is created so that a second build doesn't try to mistakenly
+ reapply it.
+
2008-05-08 Raphael Hertzog <hertzog@debian.org>
* scripts/Dpkg/Source/Functions.pm (is_binary): New function
sub register_autopatch {
my ($self, $dir) = @_;
+ my $autopatch = File::Spec->catfile($dir, "debian", "patches",
+ $self->get_autopatch_name());
+ if (-e $autopatch) {
+ my $applied = File::Spec->catfile($dir, "debian", "patches", ".dpkg-source-applied");
+ open(APPLIED, '>>', $applied) || syserr(_g("cannot write %s"), $applied);
+ print APPLIED ($self->get_autopatch_name() . "\n");
+ close(APPLIED);
+ }
}
# vim:et:sw=4:ts=8
return;
}
unless (-e $applied) {
- warning(_g("patches have not been applied, applying them now (use --no-preparation to override)"));
- $self->apply_patches($dir);
+ if (scalar($self->get_patches($dir))) {
+ warning(_g("patches have not been applied, applying them now (use --no-preparation to override)"));
+ $self->apply_patches($dir);
+ }
}
}
my $has_patch = (grep { $_ eq $auto_patch } $self->get_patches($dir)) ? 1 : 0;
my $series = $self->get_series_file($dir);
$series ||= File::Spec->catfile($dir, "debian", "patches", "series");
+ my $applied = File::Spec->catfile($dir, "debian", "patches", ".dpkg-source-applied");
if (-e "$dir/debian/patches/$auto_patch") {
# Add auto_patch to series file
if (not $has_patch) {
open(SERIES, ">>", $series) || syserr(_g("cannot write %s"), $series);
print SERIES "$auto_patch\n";
close(SERIES);
+ open(APPLIED, ">>", $applied) || syserr(_g("cannot write %s"), $applied);
+ print APPLIED "$auto_patch\n";
+ close(APPLIED);
}
} else {
# Remove auto_patch from series