diff options
author | Guillem Jover <guillem@debian.org> | 2019-10-05 04:28:30 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2019-11-26 02:42:45 +0100 |
commit | b287a80263dd4e45bb82b7e6bad76faeb47358d4 (patch) | |
tree | 0d3cb6c35e722a67561aac5813d7e9338a08d63b /scripts/Dpkg/Source | |
parent | ddb82d8bfe58e8a25444bdd772f534e0564efb3d (diff) | |
download | dpkg-b287a80263dd4e45bb82b7e6bad76faeb47358d4.tar.gz |
Dpkg::Exit: Register exit handlers also for __DIE__
This makes sure we execute the handlers on normal errors, and can thus
remove the traps from several functions to run the handlers and to then
rethrow the exception.
Diffstat (limited to 'scripts/Dpkg/Source')
-rw-r--r-- | scripts/Dpkg/Source/Package.pm | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/scripts/Dpkg/Source/Package.pm b/scripts/Dpkg/Source/Package.pm index d973c5643..d38e228e5 100644 --- a/scripts/Dpkg/Source/Package.pm +++ b/scripts/Dpkg/Source/Package.pm @@ -54,7 +54,6 @@ use Dpkg::Control; use Dpkg::Checksums; use Dpkg::Version; use Dpkg::Compression; -use Dpkg::Exit qw(run_exit_handlers); use Dpkg::Path qw(check_files_are_the_same find_command); use Dpkg::IPC; use Dpkg::Vendor qw(run_vendor_hook); @@ -520,11 +519,7 @@ sub extract { } # Try extract - eval { $self->do_extract($newdirectory) }; - if ($@) { - run_exit_handlers(); - die $@; - } + $self->do_extract($newdirectory); # Store format if non-standard so that next build keeps the same format if ($self->{fields}{'Format'} and @@ -569,11 +564,8 @@ sub before_build { sub build { my $self = shift; - eval { $self->do_build(@_) }; - if ($@) { - run_exit_handlers(); - die $@; - } + + $self->do_build(@_); } sub after_build { @@ -603,11 +595,8 @@ sub add_file { sub commit { my $self = shift; - eval { $self->do_commit(@_) }; - if ($@) { - run_exit_handlers(); - die $@; - } + + $self->do_commit(@_); } sub do_commit { |