diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-13 17:00:03 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-13 17:00:03 +0000 |
commit | 0caa2388530da2f8a29e0d447018f605abd6d387 (patch) | |
tree | 1d2ec6d8593d1dd5d14c9e15cc7e50a6189e0bd6 /usr.sbin | |
parent | 38fe693fdf788ad01669a9f61eded009523730f7 (diff) |
remove some specialness of the Filtering stuff.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm | 9 |
3 files changed, 13 insertions, 12 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index b0a4b0383d9..4e2e87af73d 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.67 2007/05/13 13:37:00 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.68 2007/05/13 17:00:02 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -117,8 +117,8 @@ sub cleanup sub match { - my ($class, $search, $filter) = @_; - return $pkgpath->match($search, $filter); + my ($class, @search) = @_; + return $pkgpath->match(@search); } 1; diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 4b735608bc6..ce389f8d360 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.28 2007/05/13 13:37:00 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.29 2007/05/13 17:00:02 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -67,8 +67,12 @@ sub stemlist sub match { - my ($self, $search) = @_; - return $search->match_repo($self); + my ($self, $search, $filter) = @_; + if (defined $filter) { + return &$filter($search->match_repo($self)); + } else { + return $search->match_repo($self); + } } sub wipe_info diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm index eefd342e48b..94b16d7f938 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepositoryList.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepositoryList.pm,v 1.10 2007/05/13 13:37:00 espie Exp $ +# $OpenBSD: PackageRepositoryList.pm,v 1.11 2007/05/13 17:00:02 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -103,12 +103,9 @@ sub available sub match { - my ($self, $search, $filter) = @_; + my ($self, @search) = @_; for my $repo (@{$self->{list}}) { - my @l = $repo->match($search); - if (defined $filter) { - @l = &$filter(@l); - } + my @l = $repo->match(@search); if (@l > 0) { return @l; } |