diff options
-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); } |