From b4120e3d85cbb78f52ede38ce99d9ba60029d037 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 17 Dec 2018 17:10:19 +0100 Subject: get_updateable_packages(): Improve readability Signed-off-by: Florian Pritz --- lib/App/ArchLinux/PackagerTools.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/App/ArchLinux') diff --git a/lib/App/ArchLinux/PackagerTools.pm b/lib/App/ArchLinux/PackagerTools.pm index 8fc22f9..216c54c 100644 --- a/lib/App/ArchLinux/PackagerTools.pm +++ b/lib/App/ArchLinux/PackagerTools.pm @@ -83,13 +83,15 @@ older) and the CPAN distribution. method get_updateable_packages($distribution_names) { my @packages; - my $repo_versions = $self->{deps}->{pacman}->get_perl_distribution_versions($distribution_names); + my $cpan = $self->{deps}->{cpan}; + my $pacman = $self->{deps}->{pacman}; + + my $repo_versions = $pacman->get_perl_distribution_versions($distribution_names); for my $dist_name ($distribution_names->@*) { - #my $repo_version = $self->{deps}->{pacman}->get_perl_distribution_version($dist_name); my $repo_version = $repo_versions->{$dist_name}; - my $dist = $self->{deps}->{cpan}->get_dist($dist_name); - if ($self->{deps}->{cpan}->is_newer_version_available($dist_name, $repo_version)) { - my $pkgname = $self->{deps}->{pacman}->get_perl_pkgname($dist_name); + my $dist = $cpan->get_dist($dist_name); + if ($cpan->is_newer_version_available($dist_name, $repo_version)) { + my $pkgname = $pacman->get_perl_pkgname($dist_name); $log->infof('New version available for dist \'%s\' in package \'%s\': %s -> %s', $dist_name, $pkgname, $repo_version, $dist->{version}); push @packages, { dist_name => $dist_name, -- cgit v1.2.3-24-g4f1b