diff options
Diffstat (limited to 'lib/App/ArchLinux/PackagerTools.pm')
-rw-r--r-- | lib/App/ArchLinux/PackagerTools.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/App/ArchLinux/PackagerTools.pm b/lib/App/ArchLinux/PackagerTools.pm index d8cb89d..0a45bb8 100644 --- a/lib/App/ArchLinux/PackagerTools.pm +++ b/lib/App/ArchLinux/PackagerTools.pm @@ -49,10 +49,35 @@ method new_no_defaults($class: $deps = {}) { return $self; } +=head3 get_distributions_in_repo + + my $dists = $app->get_distributions_in_repo(); + +Return an arrayref of hashrefs with CPAN distribution information. See +L<App::ArchLinux::PackagerTools::Pacman/"get_perl_distributions">. + +=cut + method get_distributions_in_repo() { return $self->{deps}->{pacman}->get_perl_distributions(); } +=head3 get_updateable_packages + + my $distribution_names = ['App::ArchLinux::PackagerTools', 'DBI']; + my $packages = $app->get_updateable_packages($distribution_names); + print $packages[0]->{dist_name}; + print $packages[0]->{pkgname}; + print $packages[0]->{repo_version}; + print $packages[0]->{cpan_version}; + +Accepts a list of package names and returns a list of packages that can be +updated. The returned packages contain the name of the distribution, the name +of the pacman package, and the versions of each, the pacman package (which is +older) and the CPAN distribution. + +=cut + method get_updateable_packages($distribution_names) { my @packages; for my $dist_name ($distribution_names->@*) { |