List Info

Thread: cpanplus conf.pl*2 and 20_CPANPLUS-Dist-MM.t




cpanplus conf.pl*2 and 20_CPANPLUS-Dist-MM.t
user name
2007-09-09 00:58:41
In 20_CPANPLUS-Dist-MM.t fix to unlink calls to unlink all
versions of a 
file.

In CPANPLUS/Dist/Build/t/inc/conf.pl and
CPANPLUS/t/inc/conf.pl,

save and restore PATH and PERL5LIB settings on VMS.
PATH can not be completely restored on VMS if it did not
exist due to 
limitations in the current interface.

Fix directory cleanup to use catdir() for concatenating
directories so 
that it works on VMS.

Fix unlink where needed to unlink all versions.

This leaves me with only 08_cpanplus-backend.t with a
failing test on VMS.

-John
wb8tywqsl.net
Personal Opinion Only

  
Re: cpanplus conf.pl*2 and 20_CPANPLUS-Dist-MM.t
user name
2007-10-02 10:27:08
On 09 Sep 2007, at 07:58, John E. Malmberg wrote:

> In 20_CPANPLUS-Dist-MM.t fix to unlink calls to unlink
all versions  
> of a file.

Thanks, applied.

> In CPANPLUS/Dist/Build/t/inc/conf.pl and
CPANPLUS/t/inc/conf.pl,
>
> save and restore PATH and PERL5LIB settings on VMS.
> PATH can not be completely restored on VMS if it did
not exist due  
> to limitations in the current interface.

Thanks, applied.

> Fix directory cleanup to use catdir() for concatenating
directories  
> so that it works on VMS.

Again, a few questions about this patch.

>  -91,12 +113,15 
>              next if $file =~ /^./;  # skip dot files
>
>              my $path = File::Spec->catfile( $dir,
$file );
> +            $file =~ s/.dir//i if $^O eq 'VMS';
> +            my $dirpath = File::Spec->catdir( $dir,
$file );
>
>              ### 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 $;
> +            if( -d $dirpath ) {
> +                print "Deleting directory
'$dirpath'n" if $verbose;
> +                eval { rmtree( $dirpath ) };
> +                warn "Could not delete '$dirpath'
while cleaning  
> up '$dir'"
> +                    if $;
>
>              ### regular file
>              } else {

What's the $file =~ meant to do? Why does regular $path not
work? and  
why
are we leaving $path? Is this the type of patch we might
need to do else
where as well?

--
   Jos Boumans

   How do I prove I'm not crazy to people who are?





Re: cpanplus conf.pl*2 and 20_CPANPLUS-Dist-MM.t
user name
2007-10-02 19:46:48
Jos I. Boumans wrote:
> 
> On 09 Sep 2007, at 07:58, John E. Malmberg wrote:
> 
> Thanks, applied.
> 
>> Fix directory cleanup to use catdir() for
concatenating directories  
>> so that it works on VMS.
> 
> 
> Again, a few questions about this patch.
> 
>>  -91,12 +113,15 
>>              next if $file =~ /^./;  # skip dot
files
>>
>>              my $path = File::Spec->catfile(
$dir, $file );
>> +            $file =~ s/.dir//i if $^O eq 'VMS';
>> +            my $dirpath = File::Spec->catdir(
$dir, $file );
>>
>>              ### 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 $;
>> +            if( -d $dirpath ) {
>> +                print "Deleting directory
'$dirpath'n" if $verbose;
>> +                eval { rmtree( $dirpath ) };
>> +                warn "Could not delete
'$dirpath' while cleaning  up 
>> '$dir'"
>> +                    if $;
>>
>>              ### regular file
>>              } else {
> 
> 
> What's the $file =~ meant to do? Why does regular $path
not work? and  why
> are we leaving $path? Is this the type of patch we
might need to do else
> where as well?

A directory name on VMS in VMS format ends with .dir when it
is 
referenced as a file.

In UNIX format traditionally PERL on VMS does not remove the
'.dir', 
however the VMS C library conversion routines do remove the
'.dir' and 
the VMS C library routines can not handle the '.dir' being
present on 
UNIX format filenames.

So code doing the fixup has on VMS has to be able to handle
both UNIX 
format names and VMS format names.

The regex is wrong though, because it needs to be the last
'.dir' in the 
string with an optional ';' or optional ';1' before the end.
 Also to be 
precise, the .dir should only be removed if the file is
known to 
actually be a directory.

Directories on VMS must be version 1, ';1' or they will be
treated as 
normal files by the operating system.

With ODS-5 it is possible to have a 'foo^.dir.dir' (VMS
format), and 
this regex will fail.  However such naming conventions are
evil.

So assuming that $dir is 'foo' and contains the directory
'bar', then 
$file will contain 'bar.dir'.

In order to  use it as a directory in rmtree(), it needs to
be converted 
to '[foo.bar]', and catdir() will not remove the '.dir'.

So this patch, while working, could use some touchups.

-John
wb8tywqsl.net
Personal Opinion Only

Re: cpanplus conf.pl*2 and 20_CPANPLUS-Dist-MM.t
user name
2007-10-03 07:04:22
On 03 Oct 2007, at 02:46, John E. Malmberg wrote:

> Jos I. Boumans wrote:
>> On 09 Sep 2007, at 07:58, John E. Malmberg wrote:
>> Thanks, applied.
>>> Fix directory cleanup to use catdir() for
concatenating  
>>> directories  so that it works on VMS.
>> Again, a few questions about this patch.
>>>  -91,12 +113,15 
>>>              next if $file =~ /^./;  # skip
dot files
>>>
>>>              my $path = File::Spec->catfile(
$dir, $file );
>>> +            $file =~ s/.dir//i if $^O eq
'VMS';
>>> +            my $dirpath =
File::Spec->catdir( $dir, $file );
>>>
>>>              ### 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 $;
>>> +            if( -d $dirpath ) {
>>> +                print "Deleting directory
'$dirpath'n" if  
>>> $verbose;
>>> +                eval { rmtree( $dirpath ) };
>>> +                warn "Could not delete
'$dirpath' while  
>>> cleaning  up '$dir'"
>>> +                    if $;
>>>
>>>              ### regular file
>>>              } else {
>> What's the $file =~ meant to do? Why does regular
$path not work?  
>> and  why
>> are we leaving $path? Is this the type of patch we
might need to  
>> do else
>> where as well?
>
> A directory name on VMS in VMS format ends with .dir
when it is  
> referenced as a file.

Thanks for explaining -- this hunk is applied too.

--
   Jos Boumans

   How do I prove I'm not crazy to people who are?





[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )