diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-19 09:45:34 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-19 09:45:34 +0000 |
commit | ce40ab4ad797c44e3a3aa2e3e7488435c9b70283 (patch) | |
tree | f4441004260c980de521348a8c7937f6492f1de7 /usr.sbin/pkg_add/OpenBSD/PackageRepository | |
parent | 88d1c2e77a358b8f3175a0ebf73326f20c3eff45 (diff) |
add match_locations/filter_locations methods to search stuff that returns
full pkg locations instead of package names.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackageRepository')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository/Installed.pm index 024bf06e4ba..d07e6bdcc00 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.9 2007/05/19 09:18:55 espie Exp $ +# $OpenBSD: Installed.pm,v 1.10 2007/05/19 09:45:33 espie Exp $ # # Copyright (c) 2007 Marc Espie <espie@openbsd.org> # @@ -37,6 +37,17 @@ sub match return @l; } +sub match_locations +{ + my ($self, $search, @filters) = @_; + my @l = $search->match_locations($self); + while (my $filter = (shift @filters)) { + last if @l == 0; # don't bother filtering empty list + @l = $filter->filter_locations(@l); + } + return @l; +} + sub url { my ($self, $name) = @_; |