diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-12 14:16:39 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-12 14:16:39 +0000 |
commit | 861e6a7f0cd5109d020565ea6e6c96e18c57c23e (patch) | |
tree | bc634db6bb590864b143806c7c11dc42299c794e /usr.sbin | |
parent | 0014aca8c0c07569371fd1856b48fdbc13523b17 (diff) |
also allow Spec objects in Repository matches.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index e425a622e16..fc36f394b6c 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.60 2007/05/08 08:42:02 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.61 2007/05/12 14:16:38 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -123,9 +123,13 @@ sub match_spec if (!@avail) { @avail = available(); } - require OpenBSD::PkgSpec; + if (ref $spec) { + return $spec->match(@avail); + } else { + require OpenBSD::PkgSpec; - return OpenBSD::PkgSpec::match($spec, @avail); + return OpenBSD::PkgSpec::match($spec, @avail); + } } my $stemlist; diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 73c93030579..aa9b25e0ba8 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepository.pm,v 1.21 2007/05/12 13:36:54 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.22 2007/05/12 14:16:38 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -68,8 +68,12 @@ sub findstem sub match_spec { my ($self, $spec) = @_; - require OpenBSD::PkgSpec; - return OpenBSD::PkgSpec::match_ref($spec, $self->list); + if (ref $spec) { + return $spec->match($self->list); + } else { + require OpenBSD::PkgSpec; + return OpenBSD::PkgSpec::match_ref($spec, $self->list); + } } sub wipe_info |