diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2010-12-21 11:25:20 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2010-12-21 11:25:20 +0000 |
commit | cef71760eafc9942924ef4c107df3912e8bc45ee (patch) | |
tree | 043bbcb69277a0f767b6750c31d7cd9db1b89d2c /usr.sbin/pkg_add/OpenBSD/Dependencies.pm | |
parent | 924f7087ac0208d0e8ffd68aa9bd2b438dfbbf42 (diff) |
simplify a bit:
- make find_dep_in_installed more regular
- zap the {more} entry, add_dep is okay for that purpose
- don't special case installed_list, provide older_names instead
- make PseudoSets slightly less hackish
- don't read full packinglist, prelinkstuff is exactly what we need
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Dependencies.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index 3b5842aad98..41ca0a5a7df 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.148 2010/12/20 16:30:03 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.149 2010/12/21 11:25:19 espie Exp $ # # Copyright (c) 2005-2010 Marc Espie <espie@openbsd.org> # @@ -458,9 +458,9 @@ sub check_lib_spec return; } -sub find_in_installed +sub find_dep_in_installed { - my ($self, $dep) = @_; + my ($self, $state, $dep) = @_; return $self->find_candidate($dep, @{$self->installed_list}); } @@ -472,15 +472,6 @@ sub find_dep_in_self return $self->find_candidate($dep, $self->{set}->newer_names); } -package OpenBSD::Dependencies::Solver; -our @ISA = qw(OpenBSD::Dependencies::SolverBase); - -sub add_dep -{ - my ($self, $d) = @_; - $self->{deplist}{$d} = $d; -} - use OpenBSD::PackageInfo; OpenBSD::Auto::cache(installed_list, sub { @@ -494,6 +485,14 @@ OpenBSD::Auto::cache(installed_list, } ); +sub add_dep +{ + my ($self, $d) = @_; + $self->{deplist}{$d} = $d; +} + +package OpenBSD::Dependencies::Solver; +our @ISA = qw(OpenBSD::Dependencies::SolverBase); sub merge { @@ -641,7 +640,7 @@ sub really_solve_dependency return $v if $v; } - $v = $self->find_in_installed($dep); + $v = $self->find_dep_in_installed($state, $dep); if ($v) { if ($state->{newupdates}) { if ($state->tracker->is_known($v)) { |