summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-30 17:37:37 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-30 17:37:37 +0000
commit8d34f863646a46e095ee8d62104e162431069e81 (patch)
tree2da7baec17c2a26bb98d97ec607c7a35a08e6564 /usr.sbin/pkg_add/OpenBSD/Dependencies.pm
parent62a5433220ec6f6df530f55fbf136640cfc7fa52 (diff)
also track stuff I couldn't install, and use it for negative cache lookups.
fix some looping if stuff can't install for whatever reason.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Dependencies.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 699d632097b..b49d301e45c 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.111 2009/12/30 09:36:16 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.112 2009/12/30 17:37:36 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -212,6 +212,14 @@ sub do
return $$v;
}
+package _cache::bad;
+our @ISA=(qw(_cache));
+sub do
+{
+ my ($v, $solver, $state, $dep, $package) = @_;
+ return $$v;
+}
+
package _cache::to_install;
our @ISA=(qw(_cache));
sub do
@@ -513,13 +521,17 @@ sub solve_dependency
$v = $self->find_dep_in_repositories($state, $dep);
if ($v) {
+ if (defined $state->{tracker}{cant_install}{$v->name}) {
+ set_global($dep, _cache::bad->new($v->name));
+ return $v->name;
+ }
my $s = OpenBSD::UpdateSet->from_location($v);
$state->tracker->todo($s);
$self->add_dep($s);
- $self->set_cache($dep, _cache::to_install->new($v->{name}));
- return $v->{name};
+ $self->set_cache($dep, _cache::to_install->new($v->name));
+ return $v->name;
}
# resort to default if nothing else