diff options
author | David E. Wheeler <david@kineticode.com> | 2009-07-10 10:14:39 -0700 |
---|---|---|
committer | Yves Orton <demerphq@gemini.(none)> | 2009-07-18 00:26:27 +0200 |
commit | 69a43907343338be83348549c3ca427544e91995 (patch) | |
tree | 6566cf9654547fa68c7b58ad565878b9ce7a847c /lib/ExtUtils | |
parent | 557305a74c6d0c54e5ad44e454c260ee7366f428 (diff) | |
download | perl-69a43907343338be83348549c3ca427544e91995.tar.gz |
Fix ExtUtils::Installed failure with -Duserelocatableinc
This patch fixes an issue with ExtUtils::Installed when Perl is compiled with
userelocatableinc. It looks a though the issue is that `%Config` contains
local paths when built with -Duserelocatableinc, some, at least, with a
leading "./". The solution is to use `File::Spec->canonpath()` to clean up the
path before comparing two paths that are otherwise the same. A better solution
might be to use some sort of other utility function that checks that paths are
the same even if they're not spelled the same. I didn't notice such a function
in File::Spec, alas.
Also, I'm not sure what effects this change might have on VMS; it deserves
further testing there.
Diffstat (limited to 'lib/ExtUtils')
-rw-r--r-- | lib/ExtUtils/Installed.pm | 7 | ||||
-rw-r--r-- | lib/ExtUtils/t/Installed.t | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/ExtUtils/Installed.pm b/lib/ExtUtils/Installed.pm index 8e6513998b..727a01d89a 100644 --- a/lib/ExtUtils/Installed.pm +++ b/lib/ExtUtils/Installed.pm @@ -16,7 +16,7 @@ my $DOSISH = ($^O =~ /^(MSWin\d\d|os2|dos|mint)$/); require VMS::Filespec if $Is_VMS; use vars qw($VERSION); -$VERSION = '1.43'; +$VERSION = '1.43_1'; $VERSION = eval $VERSION; sub _is_prefix { @@ -28,9 +28,8 @@ sub _is_prefix { $path = VMS::Filespec::unixify($path); } - # Sloppy Unix path normalization. - $prefix =~ s{/+}{/}g; - $path =~ s{/+}{/}g; + # Unix path normalization. + $prefix = File::Spec->canonpath($prefix); return 1 if substr($path, 0, length($prefix)) eq $prefix; diff --git a/lib/ExtUtils/t/Installed.t b/lib/ExtUtils/t/Installed.t index f820ef49c6..dd492c2d1d 100644 --- a/lib/ExtUtils/t/Installed.t +++ b/lib/ExtUtils/t/Installed.t @@ -45,7 +45,7 @@ ok( $ei->_is_type(0, 'all'), '_is_type() should be true for type of "all"' ); foreach my $path (qw( man1dir man3dir )) { SKIP: { - my $dir = $Config{$path.'exp'}; + my $dir = File::Spec->canonpath($Config{$path.'exp'}); skip("no man directory $path on this system", 2 ) unless $dir; my $file = $dir . '/foo'; |