my $cnt = keys %{$self->{is_tested}};
my $newenv = join $Config::Config{path_sep}, @dirs, @env;
$CPAN::Frontend->optprint('perl5lib', sprintf ("Prepending blib/arch and blib/lib of ".
"%d build dirs to PERL5LIB, reaching size %d; ".
"for '%s'\n", $cnt, length($newenv), $for)
);
$ENV{PERL5LIB} = $newenv;
####
#-> sub CPAN::is_tested
sub is_tested {
my($self,$what,$when) = @_;
unless ($what) {
Carp::cluck("DEBUG: empty what");
return;
}
$self->{is_tested}{$what} = $when;
}
####
sub _list_sorted_descending_is_tested {
my($self) = @_;
my $foul = 0;
my @sorted = sort
{ ($self->{is_tested}{$b}||0) <=> ($self->{is_tested}{$a}||0) }
grep
{ if ($foul){ 0 } elsif (-e) { 1 } else { $foul = $_; 0 } }
keys %{$self->{is_tested}};
if ($foul) {
$CPAN::Frontend->mywarn("Lost build_dir detected ($foul), giving up all cached test results of currently running session.\n");
for my $dbd (sort keys %{$self->{is_tested}}) { # distro-build-dir
SEARCH: for my $d (sort { $a->id cmp $b->id } $CPAN::META->all_objects("CPAN::Distribution")) {
if ($d->{build_dir} && $d->{build_dir} eq $dbd) {
$CPAN::Frontend->mywarn(sprintf "Flushing cache for %s\n", $d->pretty_id);
$d->fforce("");
last SEARCH;
}
}
delete $self->{is_tested}{$dbd};
}
return ();
} else {
return @sorted;
}
}
####
#-> sub CPAN::reset_tested
# forget all distributions tested -- resets what gets included in PERL5LIB
sub reset_tested {
my ($self) = @_;
$self->{is_tested} = {};
}