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
### 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
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;
}
### 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,
### 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};
}
### 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 {
### 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};
}
### 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 );