diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-13 12:58:55 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-13 12:58:55 +0000 |
commit | 6a5affe55843f23286e7d751d5e8e324b145dcb9 (patch) | |
tree | 03eadf86b69a588769c9f3f056fcf85c0ec5c74c /usr.sbin | |
parent | 03779222aceb38a385f53c4aa0f950efc026b72b (diff) |
make caching of stemlists implicit
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 9a6c47b2219..2dabba15f84 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.25 2007/05/13 09:31:24 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.26 2007/05/13 12:58:54 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -54,32 +54,33 @@ sub available return @{$self->list}; } -sub findstem +sub stemlist { - my ($self, $stem) = @_; + my $self = shift; if (!defined $self->{stemlist}) { require OpenBSD::PackageName; $self->{stemlist} = OpenBSD::PackageName::avail2stems($self->available); } - return $self->{stemlist}->findstem($stem); + return $self->{stemlist}; +} + +sub findstem +{ + my ($self, $stem) = @_; + 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); + return $self->stemlist->find_partialstem($partial); } sub match_spec { my ($self, $spec) = @_; - return $spec->match_ref($self->list); + return $spec->match_repo($self); } sub wipe_info |