From 58860d34d6d90e4baafde5253b5c8696024b3da4 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 18 Dec 2018 00:48:32 +0100 Subject: WIP Add maintainer filtering Signed-off-by: Florian Pritz --- lib/App/ArchLinux/PackagerTools.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib') 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 Ebluewind@xinu.atE -- cgit v1.2.3-24-g4f1b