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/pkg_add/OpenBSD/PackageLocator.pm | |
parent | 0014aca8c0c07569371fd1856b48fdbc13523b17 (diff) |
also allow Spec objects in Repository matches.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageLocator.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 10 |
1 files changed, 7 insertions, 3 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; |