summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-03-30 08:55:57 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-03-30 08:55:57 +0000
commit491d9d8d234da60bc49ff25dd034de343d579921 (patch)
treef0f56aad9f7f04ff9e9402be4fd1117e433b32c9 /usr.sbin/pkg_add
parentbba78fc2f2589554632098bceae5cfd9fb2bbea1 (diff)
wrap each install operation into eval {} so that a die there will leave
us a chance to register what's already happened.
Diffstat (limited to 'usr.sbin/pkg_add')
-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;
}