Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

resolving #73742: lost build_dir

  • Loading branch information...
commit 3895138e4f7221f264cf3ebd7453e54f1055cddf 1 parent 938d885
Andreas J. Koenig authored
Showing with 23 additions and 2 deletions.
  1. +2 −0  Changes
  2. +21 −2 lib/CPAN.pm
2  Changes
View
@@ -1,3 +1,5 @@
+ * RT #73742: watch build_dirs and react calmly when one has gone lost
+
2011-08-07 Andreas J. Koenig <andk@cpan.org>
* release 1.9800
23 lib/CPAN.pm
View
@@ -1316,9 +1316,28 @@ sub is_installed {
sub _list_sorted_descending_is_tested {
my($self) = @_;
- sort
+ my $foul = 0;
+ my @sorted = sort
{ ($self->{is_tested}{$b}||0) <=> ($self->{is_tested}{$a}||0) }
- keys %{$self->{is_tested}}
+ 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 (keys %{$self->{is_tested}}) { # distro-build-dir
+ SEARCH: for my $d ($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::set_perl5lib
Please sign in to comment.
Something went wrong with that request. Please try again.