summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/UpdateSet.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index 5b215fa729f..7f1aac3fea7 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.28 2009/11/24 10:50:18 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.29 2009/11/28 16:46:20 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -52,12 +52,21 @@ package OpenBSD::hint2;
our @ISA = qw(OpenBSD::hint);
package OpenBSD::UpdateSet;
+
sub new
{
my $class = shift;
return bless {newer => {}, older => {}, hints => []}, $class;
}
+sub set_error
+{
+ my ($self, $error) = @_;
+ for my $h ($self->older) {
+ $h->set_error($error);
+ }
+}
+
sub add_newer
{
my $self = shift;
@@ -245,10 +254,21 @@ sub merge
$tracker->remove_set($set);
# ... and mark it as already done
$set->{finished} = 1;
+ # XXX and mark it as merged, for eventual updates
+ $set->{merged} = $self;
}
# then regen tracker info for $self
$tracker->add_set($self);
return $self;
}
+sub real_set
+{
+ my $set = shift;
+ while (defined $set->{merged}) {
+ $set = $set->{merged};
+ }
+ return $set;
+}
+
1;