diff options
author | Karl Williamson <public@khwilliamson.com> | 2011-05-23 12:33:09 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2011-05-23 12:37:32 -0600 |
commit | bf8144e1686689f795fd7a70797ff1378bf75abf (patch) | |
tree | 799ce36211b0428856cbd9e702826635738c4eac | |
parent | 81fa5f19a299ce11b7b61f0eac117e6363af3c5c (diff) | |
download | perl-bf8144e1686689f795fd7a70797ff1378bf75abf.tar.gz |
podcheck.t: Convert to Un*x style for file name eq
The db keeps the file names stored in Un*x style. Convert the
filenames returned by the OS into that style to get an apples
to apples comparison
-rw-r--r-- | t/porting/podcheck.t | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/t/porting/podcheck.t b/t/porting/podcheck.t index 9005fde624..b10c6280e0 100644 --- a/t/porting/podcheck.t +++ b/t/porting/podcheck.t @@ -288,10 +288,18 @@ sub suppressed { } # This is to get this to work across multiple file systems, including those -# that are not case sensitive. The db is stored in lower case, and all file -# name comparisons are done that way. +# that are not case sensitive. The db is stored in lower case, Un*x style, +# and all file name comparisons are done that way. sub canonicalize($) { - return lc File::Spec->canonpath(shift); + my $input = shift; + my ($volume, $directories, $file) + = File::Spec->splitpath(File::Spec->canonpath($input)); + # Assumes $volume is constant for everything in this directory structure + $directories = "" if ! $directories; + $file = "" if ! $file; + my $output = lc join '/', File::Spec->splitdir($directories), $file; + $output =~ s! / /+ !/!gx; # Multiple slashes => single slash + return $output; } |