aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xperl-external/bin/module-manage.pl33
-rw-r--r--perl-external/files.txt2
-rw-r--r--perl-external/minicpan/modules/02packages.details.txt.gzbin16453 -> 20125 bytes
-rw-r--r--perl-external/modules.txt1
4 files changed, 33 insertions, 3 deletions
diff --git a/perl-external/bin/module-manage.pl b/perl-external/bin/module-manage.pl
index 187340da8..19e380055 100755
--- a/perl-external/bin/module-manage.pl
+++ b/perl-external/bin/module-manage.pl
@@ -8,6 +8,7 @@ use LWP::Simple;
use File::Slurp;
use Path::Class;
use List::MoreUtils 'uniq';
+use CPAN::ParseDistribution;
# TODO - 'updates' action that lists packages that could be updated
# TODO - add smarts to strip out old packages (could switch to building using files.txt after)
@@ -107,14 +108,40 @@ sub index_minicpan {
my @remote_packages_lines = read_packages_txt_gz($remote_packages_file);
# Find remaining in live file and add to local file
- my @lines_to_add = ();
+ my %lines_to_add = ();
foreach my $missing (@missing_files) {
print " Finding matches for '$missing'\n";
- push @lines_to_add, grep { m{$missing} } @remote_packages_lines;
+ my @matches = grep { m{$missing} } @remote_packages_lines;
+ next unless @matches;
+ $lines_to_add{$missing} = \@matches;
+ }
+
+ # for packages still not found parse out the contents
+ foreach my $missing (@missing_files) {
+ next if $lines_to_add{$missing};
+
+ print " Parsing out matches for '$missing'\n";
+
+ my ( $A, $B ) = $missing =~ m{^(.)(.)};
+ my $dist =
+ CPAN::ParseDistribution->new("$minicpan/authors/id/$A/$A$B/$missing");
+
+ my $modules = $dist->modules();
+ my @matches = ();
+
+ foreach my $module ( sort keys %$modules ) {
+ my $version = $modules->{$module} || 'undef';
+
+ # Zucchini 0.000017 C/CH/CHISEL/Zucchini-0.0.17.tar.gz
+ push @matches, "$module $version $A/$A$B/$missing\n";
+ }
+
+ $lines_to_add{$missing} = \@matches;
}
# combine and sort the lines found
- my @new_lines = sort @local_packages_lines, @lines_to_add;
+ my @new_lines = sort @local_packages_lines,
+ map { @$_ } values %lines_to_add;
unlink $local_packages_file_gz;
write_file( $local_packages_file, map { "$_\n" } packages_file_headers(),
@new_lines );
diff --git a/perl-external/files.txt b/perl-external/files.txt
index ceb9176b7..e43fc2005 100644
--- a/perl-external/files.txt
+++ b/perl-external/files.txt
@@ -4,6 +4,7 @@
/authors/id/A/AB/ABW/Template-Toolkit-2.22.tar.gz
/authors/id/A/AC/ACALPINI/Lingua-Stem-It-0.02.tar.gz
/authors/id/A/AC/ACOBURN/Lingua-EN-Tagger-0.16.tar.gz
+/authors/id/A/AD/ADAMK/Archive-Zip-1.30.tar.gz
/authors/id/A/AD/ADAMK/Class-Inspector-1.25.tar.gz
/authors/id/A/AD/ADAMK/DBD-SQLite-1.31.tar.gz
/authors/id/A/AD/ADAMK/File-Remove-1.48.tar.gz
@@ -74,6 +75,7 @@
/authors/id/D/DA/DAGOLDEN/Parse-CPAN-Meta-1.4401.tar.gz
/authors/id/D/DA/DAGOLDEN/Perl-OSType-1.002.tar.gz
/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.22.tar.gz
+/authors/id/D/DC/DCANTRELL/CPAN-ParseDistribution-1.3.tar.gz
/authors/id/D/DC/DCANTRELL/Data-Compare-1.22.tar.gz
/authors/id/D/DC/DCONWAY/Lingua-EN-Inflect-1.893.tar.gz
/authors/id/D/DL/DLAND/File-Path-2.08.tar.gz
diff --git a/perl-external/minicpan/modules/02packages.details.txt.gz b/perl-external/minicpan/modules/02packages.details.txt.gz
index 05a7c031a..1c902b5e8 100644
--- a/perl-external/minicpan/modules/02packages.details.txt.gz
+++ b/perl-external/minicpan/modules/02packages.details.txt.gz
Binary files differ
diff --git a/perl-external/modules.txt b/perl-external/modules.txt
index 33c965395..ad4caa873 100644
--- a/perl-external/modules.txt
+++ b/perl-external/modules.txt
@@ -1,5 +1,6 @@
App::cpanminus
Bundle::DBD::Pg
+CPAN::ParseDistribution
Catalyst
Catalyst::Action::RenderView
Catalyst::Authentication::Store::DBIx::Class