summaryrefslogtreecommitdiffstats
path: root/lib/App/ArchLinux/PackagerTools/CPAN.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/App/ArchLinux/PackagerTools/CPAN.pm')
-rw-r--r--lib/App/ArchLinux/PackagerTools/CPAN.pm17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/App/ArchLinux/PackagerTools/CPAN.pm b/lib/App/ArchLinux/PackagerTools/CPAN.pm
index 4faf0d6..50306c9 100644
--- a/lib/App/ArchLinux/PackagerTools/CPAN.pm
+++ b/lib/App/ArchLinux/PackagerTools/CPAN.pm
@@ -3,9 +3,9 @@ use strictures;
use autodie;
use CPAN::DistnameInfo;
-use CPANPLUS::Backend;
use Carp;
use Function::Parameters;
+use IPC::Run qw(run);
use Log::Any qw($log);
use Syntax::Keyword::Try;
use version;
@@ -37,7 +37,6 @@ Returns a new instance.
=cut
method new($class: $deps = {}) {
- $deps->{cpanplus_backend} //= CPANPLUS::Backend->new();
return $class->new_no_defaults($deps);
}
@@ -133,16 +132,16 @@ Set up the internal index of CPAN distributions
=cut
method _build_dist_index() {
- $log->debug("Updating CPANPLUS index. This may take a while");
- $self->{deps}->{cpanplus_backend}->reload_indices();
# TODO download pacakges list ourselves instead of using cpanplus for it? We may need cpanplus for other features later so keeping it is probably also fine.
-
- $log->debug("Building index...");
- my $packages_file = "$ENV{HOME}/.cpanplus/02packages.details.txt.gz";
- open my $fh, '-|', 'zcat', $packages_file;
+ $log->debug("Fetching CPAN modules index");
+ my $out;
+ run [qw(curl -s ), "https://cpan.metacpan.org/modules/02packages.details.txt.gz"], '|', ['zcat'], \$out or die $log->error("Failed to fetch and uncompress CPAN module index: $?")."\n";
+ #my $packages_file = "$ENV{HOME}/.cpanplus/02packages.details.txt.gz";
+ #open my $out, '-|', 'zcat', $packages_file;
my %seen;
my $line_number = 0;
- while (<$fh>) {
+ $log->debug("Building index...");
+ for (split /\n/, $out) {
# skip meta info (first 9 lines)
next if $line_number++ < 9;