diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-12-18 00:48:32 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-12-18 00:48:32 +0100 |
commit | 58860d34d6d90e4baafde5253b5c8696024b3da4 (patch) | |
tree | 332731ddc444c99a3b8746a1fc6fb270b454107f /lib | |
parent | b238f10d9441afe1565cf698c54b69a58bbc4a45 (diff) | |
download | App-ArchLinux-PackagerTools-58860d34d6d90e4baafde5253b5c8696024b3da4.tar.gz App-ArchLinux-PackagerTools-58860d34d6d90e4baafde5253b5c8696024b3da4.tar.xz |
WIP Add maintainer filtering
Signed-off-by: Florian Pritz <bluewind@xinu.at>
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> |