summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-29 13:51:51 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-29 13:51:51 +0000
commit26223fbd61afdc17c508b3fe872910b1906e8980 (patch)
tree7a50a2853b0fab7bbfe71716ab5f6453b4b5fd22
parent49710b88dbf15cb0063f51cdaa453b04d114a4eb (diff)
prepare for smarter sets, with cache info
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm19
2 files changed, 22 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 0f742afceee..2adc1daea28 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.103 2009/12/28 21:30:09 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.104 2009/12/29 13:51:50 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -192,6 +192,10 @@ package OpenBSD::Dependencies::Solver;
use OpenBSD::PackageInfo;
+sub merge
+{
+}
+
sub find_candidate
{
my $spec = shift;
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index acd6a404c13..d63d5650847 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.43 2009/12/28 10:42:02 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.44 2009/12/29 13:51:50 espie Exp $
#
# Copyright (c) 2007-2009 Marc Espie <espie@openbsd.org>
#
@@ -77,6 +77,7 @@ sub cleanup
}
$self->{error} //= $error;
delete $self->{solver};
+ delete $self->{conflict_cache};
$self->{finished} = 1;
}
@@ -273,10 +274,22 @@ sub from_location
return $set;
}
+sub merge_if_exists
+{
+ my ($self, $k, @extra) = @_;
+
+ if (defined $self->{$k}) {
+ $self->{$k}->merge(map {$_->{$k}} @extra);
+ }
+}
+
# Merge several updatesets together
sub merge
{
my ($self, $tracker, @sets) = @_;
+
+ $self->merge_if_exists('solver', @sets);
+ $self->merge_if_exists('conflict_cache', @sets);
# Apparently simple, just add the missing parts
for my $set (@sets) {
$self->add_newer($set->newer);
@@ -291,7 +304,9 @@ sub merge
}
# then regen tracker info for $self
$tracker->todo($self);
- delete $self->{solver};
+ if (defined $self->{solver}) {
+ delete $self->{solver}->{deplist};
+ }
return $self;
}