diff options
author | 2004-03-30 08:55:56 +0000 | |
---|---|---|
committer | 2004-03-30 08:55:56 +0000 | |
commit | 35dd527aac049d8d66871547c69d1106dc21c95d (patch) | |
tree | 70a44355b6f3cc487d961d28b7d012e4a7797b58 | |
parent | do not allow non-sensible stuff in packing-lists. (diff) | |
download | wireguard-openbsd-35dd527aac049d8d66871547c69d1106dc21c95d.tar.xz wireguard-openbsd-35dd527aac049d8d66871547c69d1106dc21c95d.zip |
wrap each install operation into eval {} so that a die there will leave
us a chance to register what's already happened.
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 06f5c590918..ac1543a4dbb 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.29 2004/03/18 16:49:50 tholo Exp $ +# $OpenBSD: pkg_add,v 1.30 2004/03/30 08:55:56 espie Exp $ # # Copyright (c) 2003 Marc Espie. # @@ -478,7 +478,12 @@ sub really_add($$) $plist->{done} = []; for my $item (@{$plist->{items}}) { - $item->install($handle, $destdir, $opt_v, $opt_n); + eval { $item->install($handle, $destdir, $opt_v, $opt_n); }; + if ($@) { + print STDERR "$@"; + $errors++; + last; + } push(@{$plist->{done}}, $item); last if $interrupted; } |