Update CPANPLUS to 0.85_06
[p5sagit/p5-mst-13.2.git] / lib / CPANPLUS / t / inc / conf.pl
index 61c4b6a..c884fd8 100644 (file)
@@ -96,6 +96,13 @@ use constant TEST_CONF_INST_MODULE      => 'Foo::Bar';
 use constant TEST_CONF_INVALID_MODULE   => 'fnurk';
 use constant TEST_CONF_MIRROR_DIR       => 'dummy-localmirror';
 use constant TEST_CONF_CPAN_DIR         => 'dummy-CPAN';
+use constant TEST_CONF_CPANPLUS_DIR     => 'dummy-cpanplus';
+use constant TEST_CONF_INSTALL_DIR      => File::Spec->rel2abs(
+                                                File::Spec->catdir(      
+                                                    TEST_CONF_CPANPLUS_DIR,
+                                                    'install'
+                                                )
+                                            );       
 
 ### we might need this Some Day when we're installing into
 ### our own sandbox. see t/20.t for details
@@ -131,13 +138,7 @@ use constant TEST_CONF_CPAN_DIR         => 'dummy-CPAN';
 #     ' INSTALLSITEMAN3DIR=' . TEST_INSTALL_DIR_MAN3;
 
 
-sub gimme_conf { 
-
-    ### don't load any other configs than the heuristic one
-    ### during tests. They might hold broken/incorrect data
-    ### for our test suite. Bug [perl #43629] showed this.
-    my $conf = CPANPLUS::Configure->new( load_configs => 0 );
-
+sub dummy_cpan_dir {
     ### VMS needs this in directory format for rel2abs
     my $test_dir = $^O eq 'VMS'
                     ? File::Spec->catdir(TEST_CONF_CPAN_DIR)
@@ -149,13 +150,25 @@ sub gimme_conf {
     ### According to John M: the hosts path needs to be in UNIX format.  
     ### File::Spec::Unix->rel2abs does not work at all on VMS
     $abs_test_dir    = VMS::Filespec::unixify( $abs_test_dir ) if $^O eq 'VMS';
+
+    return $abs_test_dir;
+}
+
+sub gimme_conf { 
+
+    ### don't load any other configs than the heuristic one
+    ### during tests. They might hold broken/incorrect data
+    ### for our test suite. Bug [perl #43629] showed this.
+    my $conf = CPANPLUS::Configure->new( load_configs => 0 );
+
+    my $dummy_cpan = dummy_cpan_dir();
     
     $conf->set_conf( hosts  => [ { 
-                        path        => $abs_test_dir,
+                        path        => $dummy_cpan,
                         scheme      => 'file',
                     } ],      
     );
-    $conf->set_conf( base       => File::Spec->rel2abs('dummy-cpanplus') );
+    $conf->set_conf( base       => File::Spec->rel2abs(TEST_CONF_CPANPLUS_DIR));
     $conf->set_conf( dist_type  => '' );
     $conf->set_conf( signature  => 0 );
     $conf->set_conf( verbose    => 1 ) if $ENV{ $Env };
@@ -170,6 +183,9 @@ sub gimme_conf {
             $conf->set_conf( makeflags => '/nologo' );
         }
     }
+
+    $conf->set_conf( source_engine =>  $ENV{CPANPLUS_SOURCE_ENGINE} )
+        if $ENV{CPANPLUS_SOURCE_ENGINE};
     
     _clean_test_dir( [
         $conf->get_conf('base'),