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

Dpkg::Source::Package: enable exit handlers for the commit operation

The commit function already uses various exit handlers to clean up in case
of failures. Unfortunately those handlers were never triggered because
there was no global eval intercepting the failures. This commit adds the
required logic.
parent 0ede9455
......@@ -514,6 +514,15 @@ sub add_file {
}
sub commit {
my $self = shift;
eval { $self->do_commit(@_) };
if ($@) {
&$_() foreach reverse @Dpkg::Exit::handlers;
die $@;
}
}
sub do_commit {
my ($self, $dir) = @_;
info(_g("'%s' is not supported by the source format '%s'"),
"dpkg-source --commit", $self->{'fields'}{'Format'});
......
......@@ -619,7 +619,7 @@ sub register_patch {
return $patch;
}
sub commit {
sub do_commit {
my ($self, $dir) = @_;
my ($patch_name, $tmpdiff) = @{$self->{'options'}{'ARGV'}};
......
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