summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-11-19 10:04:49 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-11-19 10:04:49 +0100
commit0755133217cd373f6b59bb10eb3a2ec7c0fe7a66 (patch)
treef901f59b473499d11ceb62111d72d6889bd7d088 /lib
parentdf8f04661d46f03f7c2dd4041c520c479179ed8a (diff)
downloadApp-ArchLinux-PackagerTools-0755133217cd373f6b59bb10eb3a2ec7c0fe7a66.tar.gz
App-ArchLinux-PackagerTools-0755133217cd373f6b59bb10eb3a2ec7c0fe7a66.tar.xz
Add reverse mapping of dist to pkgname
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/App/ArchLinux/PackagerTools/Pacman.pm5
1 files changed, 4 insertions, 1 deletions
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";