diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-12-18 11:32:20 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-12-18 11:32:20 +0100 |
commit | eaf37e9d61593012a693f50eea946d6abd031443 (patch) | |
tree | c89fde836d55947c65a0d2ae3dd66c64326b37ae /lib | |
parent | 5393d21d9be72ab453377e33ada3be6d7ab1a6b1 (diff) | |
download | App-ArchLinux-PackagerTools-eaf37e9d61593012a693f50eea946d6abd031443.tar.gz App-ArchLinux-PackagerTools-eaf37e9d61593012a693f50eea946d6abd031443.tar.xz |
Move pkgname/cpan dist map to configuration
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/App/ArchLinux/PackagerTools/Config.pm | 7 | ||||
-rw-r--r-- | lib/App/ArchLinux/PackagerTools/Pacman.pm | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/App/ArchLinux/PackagerTools/Config.pm b/lib/App/ArchLinux/PackagerTools/Config.pm index bd8dfc1..37826e3 100644 --- a/lib/App/ArchLinux/PackagerTools/Config.pm +++ b/lib/App/ArchLinux/PackagerTools/Config.pm @@ -116,6 +116,13 @@ method _get_default_config() { cache_timeout => '60min', mirror_url => 'https://cpan.metacpan.org/', }, + pacman => { + pkgname_to_cpan_dist_map => { + # pkgname => cpan_name + 'perl-critic' => 'Perl::Critic', + 'perl-libintl-perl' => 'libintl-perl', + }, + }, }; } diff --git a/lib/App/ArchLinux/PackagerTools/Pacman.pm b/lib/App/ArchLinux/PackagerTools/Pacman.pm index 3204ca1..e1c6300 100644 --- a/lib/App/ArchLinux/PackagerTools/Pacman.pm +++ b/lib/App/ArchLinux/PackagerTools/Pacman.pm @@ -36,12 +36,12 @@ Returns a new instance. method new($class: $context, $deps = {}) { + $deps->{config} //= App::ArchLinux::PackagerTools::Config->new($context); $deps->{cpan} //= App::ArchLinux::PackagerTools::CPAN->new($context); - $deps->{pkgname_cpan_name_map} //= { - # pkgname => cpan_name - 'perl-critic' => 'Perl::Critic', - 'perl-libintl-perl' => 'libintl-perl', - }; + + my $conf = $deps->{config}->get_config(); + $deps->{pkgname_cpan_name_map} //= $conf->{pacman}->{pkgname_to_cpan_dist_map}; + return $class->new_no_defaults($context, $deps); } |