Moin, On Friday 24 August 2007 15:15:41 John E. Malmberg wrote: > Jos I. Boumans wrote: > > On 21 Aug 2007, at 05:05, John E. Malmberg wrote: > >> In Extract.pm, upper case options to commands must be enclosed in > >> double quotes. This seems to only affect the UNZIP command. > >> > >> > >> In 01_Archive-Extract.t, to compare directory components in VMS > >> syntax, the trailing "]" needs to be removed. > >> > >> > >> --- /rsync_root/perl/lib/Archive/Extract/t/01_Archive-Extract.t > >> Mon May 28 07:33:43 2007 > >> +++ lib/Archive/Extract/t/01_Archive-Extract.t Thu Aug 16 23:06:18 > >> 2007 > >> @@ -362,6 +362,10 @@ > >> ### if something went wrong with determining > >> the out > >> ### path, don't go deleting stuff.. might be > >> Really Bad > >> my $out_re = quotemeta( $OutDir ); > >> + > >> + # Remove the directory terminator from regex > >> + my $out_re = s/\\\]// if IS_VMS; > >> + > >> if( $ae->extract_path !~ /^$out_re/ ) { > >> ok( 0, "Extractpath WRONG (".$ae- > >> > >> >extract_path.")"); > >> > >> skip( "Unsafe operation -- skip > >> cleanup!!!" ), 1; > > > > This doesn't seem to do at all what you intend -- it *redefines* > > $out_re to be the result of a substitution on $_... what did you mean > > to do exactly? > > All I meant to do was remove the trailing "]" from the existing $out_re. > Clearly I messed up. > > It is also possible that instead of a trailing "]" there could be a > trailing ">", but that opens up another can of worms as it means the > leading delimiter of the directory component is a "<" instead of the > usual "[". I am not sure how well Perl can deal with the "<xxx> form of > VMS directory syntax. > > > And shouldn't this be done in the library rather than in the test > > suite? > > I do not think so. The library was returning the directory asked for, > and that is what an application would expect. > > It appeared to me that the test was trying to do a check that one path > was contained in another. In VMS, when the file spec is in VMS syntax, > the directory specification is terminated with either a "]" or a ">". > Usually it is "]", and when Perl on VMS does a UNIX to VMS conversion it > always returns "]" > > So if a parent directory is [.foo] and the child directory is > "[.foo.bar]" and you want to test this with a string compare, you must > at a minimum remove the trailing "]" from the parent. > > For a robust compare, you must separate the file spec components and > remove the "[]<>" delimiters. > > And delimiters preceded by "^" in a VMS file specification are not > delimiters. "^" is a quote meta character to pass through special > characters with out interpretation. Most of Perl can not yet handle > that feature of VMS file specifications.
Use File::Spec for the splitting/compaision then? All the best, Tels -- Signed on Fri Aug 24 15:35:01 2007 with key 0x93B84C15. View my photo gallery: http://bloodgate.com/photos PGP key on http://bloodgate.com/tels.asc or per email. "helft den armen vögeln" -- gegen kleinschreibung
pgpo81HR1JY0V.pgp
Description: PGP signature