John E. Malmberg wrote:
In cpl_conf_pl.gdiff is a patch for lib/CPANPLUS/t/inc/conf.pl to require the ".dir" to be at the end of the file.

In cpl_dist_conf.pl is a patch to make lib/CPANPLUS/Dist/Build/t/inc/conf.pl match up with lib/CPANPLUS/t/inc/conf.pl by only doing the directory specific name modifications if the file is actually a directory.

Scratch the previous patches, I found a bug in the cleanup code, fixed in this version.

That fix exposed some bugs in lib/CPANPLUS/Config.pm, which exposed another bug in lib/CPANPLUS/Dist/Build/t/inc/conf.pl

All should be fixed now.

-John
[EMAIL PROTECTED]
Personal Opinion Only
--- /rsync_root/perl/lib/CPANPLUS/t/inc/conf.pl Fri Nov  9 16:50:29 2007
+++ lib/CPANPLUS/t/inc/conf.pl  Sun Nov 11 20:10:29 2007
@@ -62,10 +62,10 @@
         ### path is "magic" on VMS, we can not tell if it really existed before
         ### this was run, because VMS will magically pretend that a PATH
         ### environment variable exists set to the current working directory
-        $ENV{PATH} = $old_path;
+        $ENV{PATH} = $old_env_path;
 
-        if (defined $old_perl5lib) {
-            $ENV{PERL5LIB} = $old_perl5lib;
+        if (defined $old_env_perl5lib) {
+            $ENV{PERL5LIB} = $old_env_perl5lib;
         } else {
             delete $ENV{PERL5LIB};
         }
@@ -272,7 +272,7 @@
                 ### mailing-lists/perl5-porters/2007-10/msg00064.html
                 ### for details -- the below regex could use some touchups
                 ### according to John. M.            
-                $file =~ s/\.dir//i if $^O eq 'VMS';
+                $file =~ s/\.dir$//i if $^O eq 'VMS';
                 
                 my $dirpath = File::Spec->catdir( $dir, $file );
 
--- /rsync_root/perl/lib/CPANPLUS/Config.pm     Fri Nov  9 16:50:29 2007
+++ lib/CPANPLUS/Config.pm      Sun Nov 11 21:59:06 2007
@@ -555,17 +555,17 @@
 
             my $path;
             BIN: for my $bin (@bins) {
-                
+
                 ### parallel to your cpanp/cpanp-boxed
                 my $maybe = File::Spec->rel2abs(
-                                File::Spec->catdir( dirname($0), $bin )
+                                File::Spec->catfile( dirname($0), $bin )
                             );        
                 $path = $maybe and last BIN if -f $maybe;
         
                 ### parallel to your CPANPLUS.pm:
                 ### $INC{cpanplus}/../bin/cpanp-run-perl
                 $maybe = File::Spec->rel2abs(
-                            File::Spec->catdir( 
+                            File::Spec->catfile( 
                                 dirname($INC{'CPANPLUS.pm'}),
                                 '..',   # lib dir
                                 'bin',  # bin dir
@@ -580,7 +580,7 @@
                 ### CPANPLUS.pm in
                 ### /tmp/cp/lib/perl5/site_perl/5.8.8
                 $maybe = File::Spec->rel2abs(
-                            File::Spec->catdir( 
+                            File::Spec->catfile( 
                                 dirname( $INC{'CPANPLUS.pm'} ),
                                 '..', '..', '..', '..', # 4x updir
                                 'bin',                  # bin dir
@@ -599,6 +599,11 @@
                              split(/\Q$Config::Config{path_sep}\E/, 
$ENV{PATH}),
                              File::Spec->curdir, 
                 ) {             
+
+                    ### On VMS the path could be in UNIX format, and we
+                    ### currently need it to be in VMS format
+                    $dir = VMS::Filespec::vmspath($dir) if ON_VMS;
+
                     $maybe = File::Spec->catfile( $dir, $bin );
                     $path = $maybe and last BIN if -f $maybe;
                 }
--- /rsync_root/perl/lib/CPANPLUS/Dist/Build/t/inc/conf.pl      Fri Nov  9 
16:50:29 2007
+++ lib/CPANPLUS/Dist/Build/t/inc/conf.pl       Sun Nov 11 21:47:04 2007
@@ -31,7 +31,7 @@
     ### and friends get picked up
     $old_env_path = $ENV{PATH};
     $ENV{'PATH'}  = join $Config{'path_sep'}, 
-                    grep { defined } "$FindBin::Bin/../bin", $ENV{'PATH'};
+                    grep { defined } "$FindBin::Bin/../../../bin", 
$ENV{'PATH'};
 
     ### Fix up the path to perl, as we're about to chdir
     ### but only under perlcore, or if the path contains delimiters,
@@ -62,10 +62,10 @@
         ### path is "magic" on VMS, we can not tell if it really existed before
         ### this was run, because VMS will magically pretend that a PATH
         ### environment variable exists set to the current working directory
-        $ENV{PATH} = $old_path;
+        $ENV{PATH} = $old_env_path;
 
-        if (defined $old_perl5lib) {
-            $ENV{PERL5LIB} = $old_perl5lib;
+        if (defined $old_env_perl5lib) {
+            $ENV{PERL5LIB} = $old_env_perl5lib;
         } else {
             delete $ENV{PERL5LIB};
         }
@@ -127,16 +127,20 @@
             ### XXX See http://www.xray.mpe.mpg.de/
             ### mailing-lists/perl5-porters/2007-10/msg00064.html
             ### for details -- the below regex could use some touchups
-            ### according to John. M.            
-            $file =~ s/\.dir//i if $^O eq 'VMS';
-            
-            my $dirpath = File::Spec->catdir( $dir, $file );
-            
+            ### according to John. M.
+
             ### directory, rmtree it
             if( -d $path ) {
-                print "# Deleting directory '$path'\n" if $verbose;
-                eval { rmtree( $path ) };
-                warn "Could not delete '$path' while cleaning up '$dir'" if $@;
+
+                $file =~ s/\.dir$//i if $^O eq 'VMS';
+
+                ### Need a path specification here, not a file.
+                my $dirpath = File::Spec->catdir( $dir, $file );
+
+                print "# Deleting directory '$dirpath'\n" if $verbose;
+                eval { rmtree( $dirpath ) };
+                warn "Could not delete '$dirpath' while cleaning up '$dir'"
+                    if $@;
            
             ### regular file
             } else {

Reply via email to