diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm | 13 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Search.pm | 27 |
2 files changed, 5 insertions, 35 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm index b2addb1e63b..72bb318e737 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Installed.pm,v 1.14 2009/04/19 15:18:23 espie Exp $ +# $OpenBSD: Installed.pm,v 1.15 2009/11/10 14:37:20 espie Exp $ # # Copyright (c) 2007 Marc Espie <espie@openbsd.org> # @@ -26,17 +26,6 @@ use warnings; package OpenBSD::PackageRepositoryBase; -sub match -{ - my ($self, $search, @filters) = @_; - my @l = $search->match($self); - while (my $filter = (shift @filters)) { - last if @l == 0; # don't bother filtering empty list - @l = $filter->filter(@l); - } - return @l; -} - sub match_locations { my ($self, $search, @filters) = @_; diff --git a/usr.sbin/pkg_add/OpenBSD/Search.pm b/usr.sbin/pkg_add/OpenBSD/Search.pm index 6f0fbca3197..d850498b1c9 100644 --- a/usr.sbin/pkg_add/OpenBSD/Search.pm +++ b/usr.sbin/pkg_add/OpenBSD/Search.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Search.pm,v 1.15 2009/11/10 14:32:31 espie Exp $ +# $OpenBSD: Search.pm,v 1.16 2009/11/10 14:37:20 espie Exp $ # # Copyright (c) 2007 Marc Espie <espie@openbsd.org> # @@ -28,26 +28,13 @@ sub match_locations return \@l; } -# XXX this is not efficient -sub filter_locations -{ - my ($self, $l) = @_; - my $r = []; - for my $loc (@$l) { - if ($self->filter($loc->{name})) { - push(@$r, $loc); - } - } - return $r; -} - package OpenBSD::Search::PkgSpec; our @ISA=(qw(OpenBSD::Search)); -sub match_ref +sub filter { - my ($self, $r) = @_; - return $self->{spec}->match_ref($r); + my ($self, @list) = @_; + return $self->{spec}->match_ref(\@list); } sub match_locations @@ -62,12 +49,6 @@ sub filter_locations return $self->{spec}->match_locations($l); } -sub filter -{ - my ($self, @list) = @_; - return $self->match_ref(\@list); -} - sub new { my ($class, $pattern) = @_; |