Add retries to cpan deps
This commit is contained in:
parent
83ac2c4dac
commit
f2969f6975
2 changed files with 9 additions and 4 deletions
|
@ -97,14 +97,19 @@ sub get_deps {
|
||||||
return [] if _is_banned($module);
|
return [] if _is_banned($module);
|
||||||
|
|
||||||
print "Getting deps for $module\n";
|
print "Getting deps for $module\n";
|
||||||
my @cmd = (qw|cpanm --quiet --showdeps|, $module);
|
|
||||||
|
|
||||||
$SIG{TERM}="ignore";
|
|
||||||
my $out;
|
my $out;
|
||||||
my $ret = run \@cmd, '>&', \$out;
|
my $ret;
|
||||||
|
for my $tries (1..3) {
|
||||||
|
my @cmd = (qw|cpanm --quiet --showdeps|, $module);
|
||||||
|
|
||||||
die "Failed to get deps for $module: $?" unless $ret;
|
$SIG{TERM}="ignore";
|
||||||
|
$ret = run \@cmd, '>&', \$out;
|
||||||
|
|
||||||
|
warn "Failed to get deps for $module: $?" unless $ret;
|
||||||
|
last if ($ret);
|
||||||
|
}
|
||||||
|
die "FATAL: no deps for $module" unless $ret;
|
||||||
|
|
||||||
|
|
||||||
my $deps = [map {Module->new_module($_)} grep {!_is_core($_)} grep {defined $_ && $_ !~ /^\s*$/} split($/, $out)];
|
my $deps = [map {Module->new_module($_)} grep {!_is_core($_)} grep {defined $_ && $_ !~ /^\s*$/} split($/, $out)];
|
||||||
|
|
BIN
modcache.stor
BIN
modcache.stor
Binary file not shown.
Loading…
Add table
Reference in a new issue