From 62c9a7224b024a011b52aeb79cae196458fe3279 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 18 Dec 2018 10:57:56 +0100 Subject: Make allowed maintainers configurable Signed-off-by: Florian Pritz --- lib/App/ArchLinux/PackagerTools.pm | 5 ++--- lib/App/ArchLinux/PackagerTools/Config.pm | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/App') diff --git a/lib/App/ArchLinux/PackagerTools.pm b/lib/App/ArchLinux/PackagerTools.pm index fa246e6..83b357a 100644 --- a/lib/App/ArchLinux/PackagerTools.pm +++ b/lib/App/ArchLinux/PackagerTools.pm @@ -51,7 +51,6 @@ method new_no_defaults($class: $context, $deps = {}) { my $self = {}; bless $self, $class; $self->{deps} = $deps; - $self->{config} = $deps->{config}->get_config(); return $self; } @@ -154,8 +153,8 @@ 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->@*]; + my $allowed_maintainers = {map {$_ => 1} $self->{deps}->{config}->get_config()->{allowed_maintainers}->@*}; + return [grep { any {$allowed_maintainers->{$_->{name}}} $_->{maintainers}->@*} $packages->@*]; } =head1 LICENSE diff --git a/lib/App/ArchLinux/PackagerTools/Config.pm b/lib/App/ArchLinux/PackagerTools/Config.pm index 7a4f113..4477053 100644 --- a/lib/App/ArchLinux/PackagerTools/Config.pm +++ b/lib/App/ArchLinux/PackagerTools/Config.pm @@ -103,6 +103,8 @@ method _get_default_config() { cache => { root_dir => ($ENV{XDG_CACHE_HOME} // $ENV{HOME}."/.cache")."/perlpkg/v1/", }, + allowed_maintainers => [ + ], archweb => { cache_timeout => '60min', base_url => 'https://www.archlinux.org/', -- cgit v1.2.3-24-g4f1b