diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-12-10 23:43:32 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-12-10 23:43:32 +0100 |
commit | 407f5566ea831c07d070c98cf83af207288d28c0 (patch) | |
tree | 5461935a91fc319e81116915a1d56dfeadc51d2b /lib/App/ArchLinux/PackagerTools | |
parent | d02cec97b983985f4f48e607e807b46ab2ae93a6 (diff) | |
download | App-ArchLinux-PackagerTools-407f5566ea831c07d070c98cf83af207288d28c0.tar.gz App-ArchLinux-PackagerTools-407f5566ea831c07d070c98cf83af207288d28c0.tar.xz |
Fix incorrect example for get_updateable_packages()
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'lib/App/ArchLinux/PackagerTools')
-rw-r--r-- | lib/App/ArchLinux/PackagerTools/CPAN.pm | 17 |
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; |