Misc fixes needed to get script to run. #3

Merged
merged 1 commit into from Jun 17, 2012
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Split
View
@@ -74,7 +74,7 @@ my $major_error_count = 0; # exit status
# but need to make it large enough for worst case distros (eg eBay-API).
# TODO: switching to the ElasticSearch module, with cursor support, will
# probably avoid the need for this. Else we could dynamically adjust.
-my $metacpan_size = 1500;
+my $metacpan_size = 2500;

This comment has been minimized.

Show comment Hide comment
@ironcamel

ironcamel Jun 17, 2012

Contributor

I had to increase this value to get the script to work. One offending module that exceeded the 1500 number was Plack-Middleware-RequestHeaders

@ironcamel

ironcamel Jun 17, 2012

Contributor

I had to increase this value to get the script to work. One offending module that exceeded the 1500 number was Plack-Middleware-RequestHeaders

my $metacpan_calls = 0;
my $metacpan_api ||= MetaCPAN::API->new(
ua_args => [ agent => $0 ],
@@ -93,8 +93,8 @@ if (not $opt_uncached) {
# XXX this locking is flawed but good enough for my needs
# http://search.cpan.org/~pmqs/DB_File-1.824/DB_File.pm#HINTS_AND_TIPS
my $fd = $db->fd;
- open(DB_FH, "+<&=$fd") || die "dup $!";
- flock (DB_FH, LOCK_EX) || die "flock: $!";
+ open(my $DB_FH, "+<&=$fd") || die "dup $!";

This comment has been minimized.

Show comment Hide comment
@ironcamel

ironcamel Jun 17, 2012

Contributor

This supresses a warning about DB_FH only being used once.

@ironcamel

ironcamel Jun 17, 2012

Contributor

This supresses a warning about DB_FH only being used once.

+ flock ($DB_FH, LOCK_EX) || die "flock: $!";
}
my %memoize_subs = (
get_candidate_cpan_dist_releases => { generation => 1 },
@@ -994,7 +994,7 @@ sub perllocal_distro_mod_version {
our $perllocal_distro_mod_version;
if (not $perllocal_distro_mod_version) { # initial setup
warn "Only first perllocal.pod file will be processed: @$perllocalpod\n"
- if @$perllocalpod > 1;
+ if ref $perllocalpod eq 'ARRAY' and @$perllocalpod > 1;

This comment has been minimized.

Show comment Hide comment
@ironcamel

ironcamel Jun 17, 2012

Contributor

$perllocalpod is not always an arrayref.

@ironcamel

ironcamel Jun 17, 2012

Contributor

$perllocalpod is not always an arrayref.

$perllocal_distro_mod_version = {};
# extract data from perllocal.pod