diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-07-01 19:16:00 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-07-01 19:16:00 +0000 |
commit | 227d7d49bcfadeb186d8fb0e15f30ec6cca423f4 (patch) | |
tree | 7d9ab1f58df554460cec3a5b3dec01c97b5ed99d /usr.sbin/pkg_add | |
parent | 3495695089bdd37b7c3e41a165fea9c204dd73c4 (diff) |
remove the try/catch in debug mode, so that we get the errors directly...
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 37a27344af8..567fd9d4912 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.32 2010/06/30 10:51:04 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.33 2010/07/01 19:15:59 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -56,7 +56,8 @@ sub do_the_main_work sub framework { my ($self, $state) = @_; - try { + + my $do = sub { lock_db($state->{not}) unless $state->defines('nolock'); $state->check_root; $self->process_parameters($state); @@ -74,14 +75,21 @@ sub framework } # show any error, and show why we died... rethrow $dielater; - } catch { - print STDERR "$0: $_\n"; - OpenBSD::Handler->reset; - if ($_ =~ m/^Caught SIG(\w+)/o) { - kill $1, $$; - } - exit(1); }; + if ($state->defines('debug')) { + &$do; + } else { + try { + &$do; + } catch { + print STDERR "$0: $_\n"; + OpenBSD::Handler->reset; + if ($_ =~ m/^Caught SIG(\w+)/o) { + kill $1, $$; + } + exit(1); + }; + } if ($state->{bad}) { exit(1); |