summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-13 09:31:25 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-13 09:31:25 +0000
commit2d58cb6cadd79cec3ad79eb153218e0b0b306053 (patch)
treed25d7545dfe3be1003181041c93a2b04a3945c3c /usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
parent0481775edd52c193b068c7af14f04aea635b6333 (diff)
provide match_spec, findstem, find_partialstem at the repository list level,
with ld -L like semantics: we stop at the first repository which has the corresponding packages..
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index 69f260571a6..9a6c47b2219 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.24 2007/05/12 15:00:30 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.25 2007/05/13 09:31:24 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -65,6 +65,17 @@ sub findstem
return $self->{stemlist}->findstem($stem);
}
+sub find_partialstem
+{
+ my ($self, $partial) = @_;
+ if (!defined $self->{stemlist}) {
+ require OpenBSD::PackageName;
+
+ $self->{stemlist} = OpenBSD::PackageName::avail2stems($self->available);
+ }
+ return $self->{stemlist}->find_partialstem($partial);
+}
+
sub match_spec
{
my ($self, $spec) = @_;