summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2004-03-30 08:55:56 +0000
committerespie <espie@openbsd.org>2004-03-30 08:55:56 +0000
commit35dd527aac049d8d66871547c69d1106dc21c95d (patch)
tree70a44355b6f3cc487d961d28b7d012e4a7797b58
parentdo not allow non-sensible stuff in packing-lists. (diff)
downloadwireguard-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_add9
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;
}