summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-29 07:54:19 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-29 07:54:19 +0000
commit27d5f530118418e1ddd8a9e765b33105279f6ef5 (patch)
tree9a9903c6beacd1a321d4159475802fb7dc26b66b /usr.sbin/pkg_add/OpenBSD
parent0ba21d3c14e00bce9b403948df1fbf54293f2d97 (diff)
slightly simpler error handling
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index 7f1aac3fea7..93bb548bcd8 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.29 2009/11/28 16:46:20 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.30 2009/11/29 07:54:18 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -59,12 +59,18 @@ sub new
return bless {newer => {}, older => {}, hints => []}, $class;
}
-sub set_error
+sub cleanup
{
my ($self, $error) = @_;
- for my $h ($self->older) {
- $h->set_error($error);
+ for my $h ($self->older, $self->newer) {
+ $h->cleanup($error);
}
+ $self->{error} //= $error;
+}
+
+sub has_error
+{
+ &OpenBSD::Handle::has_error;
}
sub add_newer