diff options
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 15 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 14 |
2 files changed, 15 insertions, 14 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index 9950978c2f0..67010327c6d 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.18 2007/05/07 13:12:11 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.19 2007/05/07 13:27:28 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -27,15 +27,6 @@ use OpenBSD::SharedLibs; use OpenBSD::Error; use OpenBSD::Interactive; -my @avail; -sub available -{ - if (!@avail) { - @avail = OpenBSD::PackageLocator::available(); - } - return @avail; -} - sub find_candidate { my $dep = shift; @@ -90,8 +81,10 @@ sub solve next; } } + require OpenBSD::PackageLocator; + # try with list of available packages - my @candidates = OpenBSD::PkgSpec::match($dep->{pattern}, available()); + my @candidates = OpenBSD::PackageLocator->match_spec($dep->{pattern}); if (!$state->{forced}->{allversions}) { @candidates = OpenBSD::PackageName::keep_most_recent(@candidates); } diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index 0d98c4e2a0c..f4e95de293b 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocator.pm,v 1.57 2007/05/02 15:05:30 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.58 2007/05/07 13:27:28 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -115,10 +115,18 @@ sub cleanup $pkgpath->cleanup; } +my @avail; + sub match_spec { - my $self = shift; - return $pkgpath->match_spec(@_); + my ($class, $spec) = @_; + if (!@avail) { + @avail = available(); + } + require OpenBSD::PkgSpec; + + return OpenBSD::PkgSpec::match($spec); } + 1; |