PERL PERL5 PORTERS 13 INTEGRATION OF PATHTOOLS 3 04
Date: Thu, 17 Feb 2005 19:44:19 +0100

Subject: Integration of PathTools 3.04
From: rgarciasuarez@no-spam (Rafael Garcia-Suarez)

I've upgraded bleadperl to PathTools 3.04, but I've applied the following patches on top of it :

The first one allows to run Cwd from miniperl
--- PathTools-3.04/Cwd.pm 2005-02-07 01:26:55.000000000 +0100
+++ bleadperl/lib/Cwd.pm 2005-02-17 19:24:19.584093712 +0100
@@no-spam -199,7 +199,7 @@no-spam return 1;
}
-
+eval {
if ( $] >= 5.006 ) {
require XSLoader;
XSLoader::load( __PACKAGE__, $VERSION );
@@no-spam -208,6 +208,7 @@no-spam push @no-spam 'DynaLoader';
__PACKAGE__->bootstrap( $VERSION );
}
+};
# Must be after the DynaLoader stuff:
$VERSION = eval $VERSION;
End
The second one prevents a test failure
--- PathTools-3.04/t/cwd.t 2005-02-07 01:26:55.000000000 +0100
+++ bleadperl/ext/Cwd/t/cwd.t 2005-02-17 19:35:35.966267992 +0100
@@no-spam -25,7 +25,10 @@no-spam $tests += 4 if $EXTRA_ABSPATH_TESTS;
plan tests => $tests;
-like $INC{'Cwd.pm'}, qr{blib}i, "Cwd should be loaded from blib/ during testing";

+SKIP: {
+ skip "not suitable for core perl testing", 1 if $ENV{PERL_CORE};
+ like $INC{'Cwd.pm'}, qr{blib}i, "Cwd should be loaded from blib/ during testing";

+}
my $IsVMS = $^O eq 'VMS';
my $IsMacOS = $^O eq 'MacOS';
End
Please include them in the next version.


Date: Fri, 18 Feb 2005 16:31:50 +0100

Subject: Re: Integration of PathTools 3.04
From: demerphq@no-spam (Demerphq)
On Thu, 17 Feb 2005 19:44:19 +0100, Rafael Garcia-Suarez <rgarciasuarez@no-spam> wrote:
> I've upgraded bleadperl to PathTools 3.04....

Cwd.pm fails with the following results:

not ok 27 - abs_path() works on files in the root directory # Failed test (cwd.t at line 210)
# got: 'E://header_files.zip'
# expected: '\header_files.zip'
not ok 28 - fast_abs_path() works on files in the root directory # Failed test (cwd.t at line 211)
# got: 'E://header_files.zip'
# expected: '\header_files.zip'

It appears to fail because File::Spec returns "/" as the root path,
but things like catfile() which are used as part of the test, as well as internally in Cwd() use '\' as their seperator. Ie:

E:\blead_trie>perl -MFile::Spec -le "print for File::Spec->rootdir,File::Spec->catfile(File::Spec->rootdir,'foo.bar')"
/
\foo.bar
The following patch fixes this:

--- \blead_perl\lib\Cwd.pm 2005-02-17 19:41:20.000000000 +0100
+++ lib\Cwd.pm 2005-02-18 16:13:14.859375000 +0100
@@no-spam -582,8 +582,9 @@no-spam
return fast_abs_path($link_target);
}
-
- return $dir eq File::Spec->rootdir + my $tdir=$dir;
+ $tdir=~s![\\]!/!g if $^O=~/win32/i;
+ return $tdir eq File::Spec->rootdir ? File::Spec->catpath($vol, $dir, $file)
: fast_abs_path(File::Spec->catpath($vol, $dir, '')) . '/' . $file;
}
-- First they ignore you, then they laugh at you, then they fight you,
then you win.
+Gandhi

Date: Fri, 18 Feb 2005 17:02:38 +0100

Subject: Re: Integration of PathTools 3.04
From: rgarciasuarez@no-spam (Rafael Garcia-Suarez)
demerphq wrote:
> On Thu, 17 Feb 2005 19:44:19 +0100, Rafael Garcia-Suarez > <rgarciasuarez@no-spam> wrote:
> > I've upgraded bleadperl to PathTools 3.04....
> > Cwd.pm fails with the following results:
> > not ok 27 - abs_path() works on files in the root directory > # Failed test (cwd.t at line 210)
> # got: 'E://header_files.zip'
> # expected: '\header_files.zip'
> not ok 28 - fast_abs_path() works on files in the root directory > # Failed test (cwd.t at line 211)
> # got: 'E://header_files.zip'
> # expected: '\header_files.zip'
> > It appears to fail because File::Spec returns "/" as the root path,
> but things like catfile() which are used as part of the test, as well > as internally in Cwd() use '\' as their seperator. Ie:
> > E:\blead_trie>perl -MFile::Spec -le "print for > File::Spec->rootdir,File::Spec->catfile(File::Spec->rootdir,'foo.bar')"
> /
> \foo.bar > > The following patch fixes this:

I applied this :
(btw, don't inline patches with gmail, it removes tabs)

Change 23982 by rgs@no-spam on 2005/02/18 15:34:59

Subject: Re: Integration of PathTools 3.04
From: demerphq <demerphq@no-spam>
Date: Fri, 18 Feb 2005 16:31:50 +0100
Message-ID: <9b18b31105021807316af0aed5@no-spam>

Affected files ...

... //depot/perl/lib/Cwd.pm#87 edit
Differences ...

==== //depot/perl/lib/Cwd.pm#87 (text) ====

@@no-spam -170,7 +170,7 @@no-spam use Exporter;
use vars qw(@no-spam @no-spam @no-spam $VERSION);
-$VERSION = '3.04';
+$VERSION = '3.04_01';
@no-spam = qw/ Exporter /;
@no-spam = qw(cwd getcwd fastcwd fastgetcwd);
@@no-spam -583,7 +583,9 @@no-spam return fast_abs_path($link_target);
}
- return $dir eq File::Spec->rootdir + my $tdir = $dir;
+ $tdir =~ s!\\!/!g if $^O eq 'MSWin32';
+ return $tdir eq File::Spec->rootdir ? File::Spec->catpath($vol, $dir, $file)
: fast_abs_path(File::Spec->catpath($vol, $dir, '')) . '/' . $file;
}
End of patch
Ken, remember that it's not the only patch I applied over CPAN's Cwd 3.04.