diff options
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index dc447ec16db..f0c39661bb6 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.136 2004/12/07 19:09:04 espie Exp $ +# $OpenBSD: pkg_add,v 1.137 2004/12/09 18:46:00 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -328,7 +328,19 @@ sub really_add($$) OpenBSD::ProgressMeter::set_header($plist->{replacing}->pkgname()." (deleting)"); $state->set_pkgname($plist->{replacing}->pkgname()); require OpenBSD::Delete; - OpenBSD::Delete::delete_plist($plist->{replacing}, $state); + eval { + OpenBSD::Delete::delete_plist($plist->{replacing}, $state); + }; + if ($@) { + Warn $@; + if ($not) { + Fatal "Deinstallation of ", + $plist->{replacing}->pkgname(), " failed"; + } else { + OpenBSD::Add::borked_installation($plist, $dir); + } + } + delete_installed($plist->{replacing}->pkgname()); OpenBSD::ProgressMeter::set_header("$pkgname (installing)"); |