diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-11-30 16:15:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-11-30 16:15:14 +0000 |
commit | 204705514b4b2e5638e7836c13bb9ada8e73d624 (patch) | |
tree | a38f5745f94d9a082addb831af416a2be7c4900c | |
parent | 13edd436d4838f91280f0491a9607a5a2f2e55fa (diff) |
better errors: have $set->cleanup mark set as finished.
in case there is an issue, register set as not updateable with tracker.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/UpdateSet.pm | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 11 |
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm index 93bb548bcd8..13737b9e321 100644 --- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm +++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: UpdateSet.pm,v 1.30 2009/11/29 07:54:18 espie Exp $ +# $OpenBSD: UpdateSet.pm,v 1.31 2009/11/30 16:15:13 espie Exp $ # # Copyright (c) 2007 Marc Espie <espie@openbsd.org> # @@ -66,6 +66,7 @@ sub cleanup $h->cleanup($error); } $self->{error} //= $error; + $self->{finished} = 1; } sub has_error diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index a9502be9e5f..aaa7181c1f5 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.405 2009/11/30 15:49:52 espie Exp $ +# $OpenBSD: pkg_add,v 1.406 2009/11/30 16:15:13 espie Exp $ # # Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org> # @@ -165,7 +165,7 @@ sub complete if (!$set->{installable}) { $set->cleanup(OpenBSD::Handle::CANT_INSTALL); - $set->{finished} = 1; + $state->tracker->mark_cant_update($set); } return 1; } @@ -542,6 +542,7 @@ sub install_set $handle->error_message, "\n"); $bad++; $set->cleanup($handle->has_error); + $state->tracker->mark_cant_update($set); return (); } @@ -550,6 +551,7 @@ sub install_set $state->log($handle->pkgname, " is not for the right architecture"); if (!$defines{arch}) { $set->cleanup(OpenBSD::Handle::CANT_INSTALL); + $state->tracker->mark_cant_update($set); return (); } } @@ -602,11 +604,8 @@ sub install_set # } # } really_add($set, $state); - for my $handle ($set->newer) { - $handle->cleanup; - } + $set->cleanup; $state->tracker->mark_installed($set); - $set->{finished} = 1; return (); } |