--- ./CPAN.pm.orig	Mon Dec 15 00:35:16 2003
+++ ./CPAN.pm	Mon Dec 15 00:52:40 2003
@@ -4825,7 +4825,7 @@ sub persistent_tested_ok {
   return unless $CPAN::Index::BUILD_DIRS and $CPAN::Config->{expire_old_builds};
   my $dir = $CPAN::Index::BUILD_DIRS->{$self->id};
   return unless $dir and -d $dir;
-  my $cpan_test_ok = File::Spec->catfile($dir, '.cpantok');
+  my $cpan_test_ok = File::Spec->catfile($dir, 'cpantok#');
   return unless -f $cpan_test_ok;
   return if $CPAN::Config->{expire_old_builds} > 0
 	    and -M $cpan_test_ok > $CPAN::Config->{expire_old_builds};
@@ -4849,7 +4849,7 @@ sub mark_persistent_tested_ok {
   my($self) = @_;
   my $dir = $self->{build_dir};
   return unless -d $dir;
-  my $cpan_test_ok = File::Spec->catfile($dir, '.cpantok');
+  my $cpan_test_ok = File::Spec->catfile($dir, 'cpantok#');
   local *T;
   open T, "> $cpan_test_ok" or warn("error touching $cpan_test_ok: $!\n"), return;
   print T $self->persistent_key;		# Something very build-specific
@@ -4874,6 +4874,7 @@ sub mark_tested_ok {
     my($self) = @_;
     $self->{make} = "YES";
     $self->{make_test} = "YES";
+    $self->{writemakefile} = "YES";
     my $c;
     foreach $c ($self->containsmods) {
         my $obj = CPAN::Shell->expandany($c);
@@ -4902,6 +4903,9 @@ sub test {
 	    Carp::croak("Couldn't chdir to $self->{'build_dir'}");
 	 $self->debug("Changed directory to $self->{'build_dir'}")
 	    if $CPAN::DEBUG;
+	 if (my @prereq = $self->unsat_prereq($for or 'test')){
+	   return 1 if $self->follow_prereqs(@prereq); # signal success to the queuerunner
+	 }
 	 return;
     }
     $self->make;
