diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/ArchLinux/PackagerTools.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/App/ArchLinux/PackagerTools.pm b/lib/App/ArchLinux/PackagerTools.pm index 720f056..fa246e6 100644 --- a/lib/App/ArchLinux/PackagerTools.pm +++ b/lib/App/ArchLinux/PackagerTools.pm @@ -7,6 +7,7 @@ our $VERSION = "0.01"; use autodie; use Function::Parameters; use Log::Any qw($log); +use List::Util 1.33 qw(any); use App::ArchLinux::PackagerTools::Pacman; use App::ArchLinux::PackagerTools::CPAN; @@ -144,6 +145,19 @@ method add_maintainers($packages) { return \@packages_with_maintainer; } +=head3 filter_by_maintainer + + my $filtered_packages = $app->filter_by_maintainer($packages); + +Filter a list of packages to the maintainers whitelisted in the config file. + +=cut + +method filter_by_maintainer($packages) { + # TODO make configurable + return [grep { any {$_->{name} eq 'bluewind'} $_->{maintainers}->@*} $packages->@*]; +} + =head1 LICENSE Copyright (C) 2018 Florian Pritz E<lt>bluewind@xinu.atE<gt> |