Skip Menu |
 

This queue is for tickets about the File-Path CPAN distribution.

Report information
The Basics
Id: 40512
Status: rejected
Priority: 0/
Queue: File-Path

People
Owner: dland [...] cpan.org
Requestors: cberry [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.06_06
Fixed in: (no value)



Subject: recent breakage on VMS
Download (untitled) / with headers
text/plain 1.2k
I'm seeing the unpleasantness below with 2.06_06 in blead@34629 built with HP C V7.3-009 on OpenVMS Alpha V8.3. No debugging time yet but I'll try to sort this out (after downloading 2.06_07) in the next couple of days and hopefully come up with a patch. 1..114 ok 1 - use Cwd; ok 2 - use File::Path; ok 3 - use File::Spec::Functions; ok 4 - mkdir parent dir 0111 ok 5 - mkdir child dir 0111 ok 6 - mhx does not exist 0111 ok 7 - mkdir parent dir 0777 ok 8 - mkdir child dir 0777 ok 9 - mhx does not exist 0777 ok 10 - created list of directories ok 11 - skipped making existing directory ok 12 - rmtree'ed a file ok 13 - Can't create a directory named '' not ok 14 - baseline 0 # Failed test 'baseline 0' # at [-.lib.file]path.t line 101. # '0' # > # '0' ok 15 - first after 0 ok 16 - second after 1 not ok 17 - ARGV 0 # Failed test 'ARGV 0' # at [-.lib.file]path.t line 118. # '0' # > # '0' ok 18 - third after 0 ok 19 - fourth after 1 cannot chdir to D0:[CRAIG.perl.t.remove.this.dir] from D0:[CRAIG.perl.t.remove]: invalid argument, aborting. at [-.lib.file]path.t l ine 148 # Looks like you planned 114 tests but ran 19. # Looks like you failed 2 tests of 19 run. # Looks like your test exited with 1 just after 19.
Subject: [PATCH] recent breakage on VMS
Download (untitled) / with headers
text/plain 1.4k
On Wed Oct 29 20:13:39 2008, CBERRY wrote: Show quoted text
> I'll try to sort this out (after downloading 2.06_07) in the > next couple of days and hopefully come up with a patch.
Patch attached against 2.06_07. There is only one change to Path.pm, in the code that checks for "ancestor error." On VMS, you cannot determine that disk:[dir1.dir2] is the parent of disk:[dir1.dir2.dir3] by comparing the two up to the full length of the former because the ']' in the first obviously does not match the '.' in the second. So I subtract one from the comparison length on VMS only. Then I skip the check if the length goes to zero since that's what we'll get if someone passes a one-character dir name like '0' which some of tests do. I'm not sure why you would want to preserve '0' in the list to be passed to _rmtree, but that's what it does and I didn't change it. The other main problem was that a couple of the tests create an empty directory, count the number of files in it by iterating over readdir(), and then fail unless the resulting count is greater than zero. That sort of defies the common sense definition of "empty" and in fact I do get exactly zero files in an empty directory, so the tests were failing. I made them pass by creating one file, but I don't really know if that's right since I don't know what the intent is here. Finally, I skip tests that depend on symlinks when symlinks are not available ($Config[d_symlink} not set).
--- Path.pm;-0 Wed Oct 29 09:39:48 2008 +++ Path.pm Thu Oct 30 07:55:17 2008 @@ -169,7 +169,11 @@ sub rmtree { # need to fixup case and map \ to / on Windows my $ortho_root = $^O eq 'MSWin32' ? _slash_lc($p) : $p; my $ortho_cwd = $^O eq 'MSWin32' ? _slash_lc($arg->{cwd}) : $arg->{cwd}; - if ($ortho_root eq substr($ortho_cwd, 0, length($ortho_root))) { + my $ortho_root_length = length($ortho_root); + $ortho_root_length-- if $^O eq 'VMS'; # don't compare '.' with ']' + if ($ortho_root_length + && (substr($ortho_root, 0, $ortho_root_length) + eq substr($ortho_cwd, 0, $ortho_root_length))) { local $! = 0; _error($arg, "cannot remove path when cwd is $arg->{cwd}", $p); next; --- t/path.t;-0 Mon Oct 20 16:36:11 2008 +++ t/path.t Thu Oct 30 07:43:57 2008 @@ -3,6 +3,7 @@ use strict; use Test::More tests => 114; +use Config; BEGIN { use_ok('Cwd'); @@ -97,6 +98,8 @@ sub count { { mkdir 'solo', 0755; chdir 'solo'; + open my $f, '>', 'foo.dat'; + close $f; my $before = count(curdir()); cmp_ok($before, '>', 0, "baseline $before"); @@ -114,6 +117,8 @@ sub count { { mkdir 'solo', 0755; chdir 'solo'; + open my $f, '>', 'foo.dat'; + close $f; my $before = count(curdir()); cmp_ok($before, '>', 0, "ARGV $before"); { @@ -301,6 +306,7 @@ SKIP: { # test bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=487319 skip "Don't need Force_Writeable semantics on $^O", 4 if grep {$^O eq $_} qw(amigaos dos epoc MSWin32 MacOS os2); + skip "Symlinks not available", 4 unless $Config{'d_symlink'}; $dir = 'bug487319'; $dir2 = 'bug487319-symlink'; @created = make_path($dir, {mask => 0700}); @@ -358,6 +364,7 @@ my $extra = catdir(curdir(), qw(EXTRA 1 SKIP: { skip "extra scenarios not set up, see eg/setup-extra-tests", 14 unless -e $extra; + skip "Symlinks not available", 14 unless $Config{'d_symlink'}; my ($list, $err); $dir = catdir( 'EXTRA', '1' );
Download (untitled) / with headers
text/plain 702b
On Thu Oct 30 09:48:43 2008, CBERRY wrote: Show quoted text
> On Wed Oct 29 20:13:39 2008, CBERRY wrote:
> > I'll try to sort this out (after downloading 2.06_07) in the > > next couple of days and hopefully come up with a patch.
> > Patch attached against 2.06_07. There is only one change to Path.pm, > in the code that > checks for "ancestor error." On VMS, you cannot determine that > disk:[dir1.dir2] is the parent > of disk:[dir1.dir2.dir3] by comparing the two up to the full length of > the former because the > ']' in the first obviously does not match the '.' in the second.
Looks good. I've folded this into my repo and I've uploaded 2.06_08. If all goes well, this will soon become 2.07. Thanks, David
CC: cberry [...] cpan.org
Subject: Re: [rt.cpan.org #40512] recent breakage on VMS
Date: Wed, 05 Nov 2008 07:21:18 -0600
To: bug-File-Path [...] rt.cpan.org
From: "Craig A. Berry" <craigberry [...] mac.com>
Download (untitled) / with headers
text/plain 588b
On Nov 4, 2008, at 6:17 PM, David Landgren via RT wrote: Show quoted text
> > Looks good. I've folded this into my repo and I've uploaded 2.06_08. > If > all goes well, this will soon become 2.07.
Thanks, that had the desired effect. There was one new test failure in 2.06_08 that's easily fixed (see attached). We no longer count differently from everybody else when removing a directory in safe mode. Show quoted text
________________________________________ Craig A. Berry mailto:craigberry@mac.com "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
Download path_t.txt
text/plain 335b

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 491b
On Wed Nov 05 08:21:33 2008, craigberry@mac.com wrote: Show quoted text
> > On Nov 4, 2008, at 6:17 PM, David Landgren via RT wrote:
> > > > Looks good. I've folded this into my repo and I've uploaded 2.06_08. > > If > > all goes well, this will soon become 2.07.
> > > Thanks, that had the desired effect. There was one new test failure > in 2.06_08 that's easily fixed (see attached). We no longer count > differently from everybody else when removing a directory in safe mode.
Applied, thanks.
Fixed in 2.07. Thanks, David
Download (untitled) / with headers
text/plain 844b
On Mon Nov 10 11:26:37 2008, DLAND wrote: Show quoted text
> Fixed in 2.07.
Sigh. I goofed. That last little patch here: http://rt.cpan.org/Ticket/Attachment/529184/264928/path_t.txt needs to be reverted. It turns out I was testing with a privileged account (bad me) so I was actually able to delete a directory in safe mode. The normal behavior on VMS is that even the owner cannot delete a directory without explicitly adding delete permission (which is off by default). In rmtree's safe mode, we preserve this behavior, but without safe mode we do the unixy thing and do whatever it takes to complete the deletion. Sorry for the churn. This only affects a test and not anything that gets installed, so I don't think it merits a release on its own. It'll probably confuse a few people having 5.8.9 ship that way but it won't do any real harm.
Apparently was not originally an issue according to the OP.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.