summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-12-18 10:57:56 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-12-18 10:57:56 +0100
commit62c9a7224b024a011b52aeb79cae196458fe3279 (patch)
tree979334e351c9df9c985baf64843b8ab9b3f093e2
parent8efd5599020b970f58b0a9ca5dc95475948901c0 (diff)
downloadApp-ArchLinux-PackagerTools-62c9a7224b024a011b52aeb79cae196458fe3279.tar.gz
App-ArchLinux-PackagerTools-62c9a7224b024a011b52aeb79cae196458fe3279.tar.xz
Make allowed maintainers configurable
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--lib/App/ArchLinux/PackagerTools.pm5
-rw-r--r--lib/App/ArchLinux/PackagerTools/Config.pm2
2 files changed, 4 insertions, 3 deletions
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/',