diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-17 15:35:59 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-17 15:35:59 +0000 |
commit | 3017ba8ae131a3dd955e5dc64dc6f00c39243a34 (patch) | |
tree | ccbdd4b8feb8b14e69a7d68c4f04e2fa805a65b5 /usr.sbin/pkg_add | |
parent | 30d6f2a3ea47e718356a3d85371eb090cdd6edba (diff) |
move the library lookup code into Solver, so that I can turn it into
methods as well...
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index bce3d732d73..ea125175d01 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.33 2007/05/17 14:08:49 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.34 2007/05/17 15:35:58 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -49,6 +49,12 @@ sub dependencies } } +sub has_dep +{ + my ($self, $dep) = @_; + return $self->{to_register}->{$dep}; +} + sub pkgname { my $self = shift; @@ -159,8 +165,6 @@ sub dump } } -package OpenBSD::Dependencies; - use OpenBSD::SharedLibs; sub check_lib_spec diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 96d8a3932f3..791a1fd6483 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.250 2007/05/17 14:13:40 espie Exp $ +# $OpenBSD: pkg_add,v 1.251 2007/05/17 15:35:58 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -560,7 +560,7 @@ sub install_package my $okay = 1; for my $lib (@{$plist->{wantlib}}) { my $extra = {}; - if (!OpenBSD::Dependencies::lookup_library($state, $lib->{name}, $plist, + if (!OpenBSD::Dependencies::Solver::lookup_library($state, $lib->{name}, $plist, $handle->{solved_dependencies}, $extra)) { Warn "Can't install $pkg: lib not found ", $lib->{name}, "\n"; clue($extra) if $okay; |