From 0755133217cd373f6b59bb10eb3a2ec7c0fe7a66 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 19 Nov 2018 10:04:49 +0100 Subject: Add reverse mapping of dist to pkgname Signed-off-by: Florian Pritz --- lib/App/ArchLinux/PackagerTools/Pacman.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/App/ArchLinux/PackagerTools') diff --git a/lib/App/ArchLinux/PackagerTools/Pacman.pm b/lib/App/ArchLinux/PackagerTools/Pacman.pm index b9fe988..39c78e5 100644 --- a/lib/App/ArchLinux/PackagerTools/Pacman.pm +++ b/lib/App/ArchLinux/PackagerTools/Pacman.pm @@ -48,6 +48,7 @@ method new($class: $deps = {}) { method new_no_defaults($class: $deps = {}) { my $self = {}; bless $self, $class; + $deps->{cpan_name_pkgname_map} = {reverse $deps->{pkgname_cpan_name_map}->%*}; $self->{deps} = $deps; return $self; } @@ -166,7 +167,9 @@ also return other names if they are mapped differently. =cut method get_perl_pkgname($dist_name) { - # TODO implement mapping + if (defined $self->{deps}->{cpan_name_pkgname_map}->{$dist_name}) { + return $self->{deps}->{cpan_name_pkgname_map}->{$dist_name}; + } my $pkgname = lc($dist_name); $pkgname =~ s/::/-/g; $pkgname = "perl-$pkgname"; -- cgit v1.2.3-24-g4f1b