diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-10-15 22:41:51 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-10-15 22:41:51 +0000 |
commit | 6b0dbfaa01142683a20972310be32c08332bccc7 (patch) | |
tree | 923f1901a3c8c7aba40fb4eaea47d014909951c5 | |
parent | 50c849c66bb68b270aafb91ca2f146a6f4faa34c (diff) |
allow solve to find dependencies in current UpdateSet
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index 53290201cc6..a53a1ddf79c 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.76 2009/10/15 22:32:13 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.77 2009/10/15 22:41:50 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -243,6 +243,15 @@ sub find_dep_in_repositories } } +sub find_dep_in_self +{ + my ($self, $state, $dep) = @_; + + return find_candidate($dep->spec, + map {$_->pkgname} $self->{set}->newer); + +} + sub find_dep_in_stuff_to_install { my ($self, $state, $dep) = @_; @@ -257,6 +266,11 @@ sub solve_dependency my $v; if ($state->{allow_replacing}) { + + $v = $self->find_dep_in_self($state, $dep); + if ($v) { + return $v; + } $v = $self->find_dep_in_stuff_to_install($state, $dep); if ($v) { push(@{$self->{deplist}}, $state->{tracker}->{to_install}->{$v}); |