Commit fddd49ee authored by Raphaël Hertzog's avatar Raphaël Hertzog

dpkg-source: keep the current patch header when regenerating the automatic patch

When dpkg-source regenerates the automatic patch (with formats "2.0" or
"3.0 (quilt)") it will keep the current patch header to avoid losing
changes made by the maintainer.
Reported-by: Cyril Brulebois's avatarCyril Brulebois <kibi@debian.org>
parent d26b9812
......@@ -5,6 +5,9 @@ dpkg (1.16.5) UNRELEASED; urgency=low
patch. Closes: #652970
And it will display a message explaining the most likely cause of
failure (patch applying with fuzz).
* When dpkg-source regenerates the automatic patch (with formats "2.0"
or "3.0 (quilt)") it will keep the current patch header to avoid
losing changes made by the maintainer.
[ Updated dpkg translations ]
* Swedish (Peter Krefting).
......
......@@ -380,7 +380,14 @@ sub generate_patch {
my $diff = Dpkg::Source::Patch->new(filename => $tmpdiff,
compression => "none");
$diff->create();
$diff->set_header($self->get_patch_header($dir));
if ($opts{'header_from'} and -e $opts{'header_from'}) {
my $header_from = Dpkg::Source::Patch->new(
filename => $opts{'header_from'});
my $analysis = $header_from->analyze($dir, verbose => 0);
$diff->set_header($analysis->{'patchheader'});
} else {
$diff->set_header($self->get_patch_header($dir));
}
$diff->add_diff_directory($tmp, $dir, basedirname => $basedirname,
%{$self->{'diff_options'}},
handle_binary_func => $opts{'handle_binary'},
......@@ -501,6 +508,7 @@ sub do_build {
my $autopatch = File::Spec->catfile($dir, "debian", "patches",
$self->get_autopatch_name());
my $tmpdiff = $self->generate_patch($dir, order_from => $autopatch,
header_from => $autopatch,
handle_binary => $handle_binary,
skip_auto => $self->{'options'}{'auto_commit'},
usage => 'build');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment