Change 31747 by [EMAIL PROTECTED] on 2007/08/22 11:20:52
Subject: [EMAIL PROTECTED] Extract fix on VMS.
From: "John E. Malmberg" <[EMAIL PROTECTED]>
Date: Mon, 20 Aug 2007 22:05:11 -0500
Message-id: <[EMAIL PROTECTED]>
Quote -Z for unzip.
Affected files ...
... //depot/perl/lib/Archive/Extract.pm#6 edit
... //depot/perl/lib/Archive/Extract/t/01_Archive-Extract.t#5 edit
Differences ...
==== //depot/perl/lib/Archive/Extract.pm#6 (text) ====
Index: perl/lib/Archive/Extract.pm
--- perl/lib/Archive/Extract.pm#5~31538~ 2007-07-06 01:09:12.000000000
-0700
+++ perl/lib/Archive/Extract.pm 2007-08-22 04:20:52.000000000 -0700
@@ -17,6 +17,9 @@
use constant ON_SOLARIS => $^O eq 'solaris' ? 1 : 0;
use constant FILE_EXISTS => sub { -e $_[0] ? 1 : 0 };
+### VMS may require quoting upper case command options
+use constant ON_VMS => $^O eq 'VMS' ? 1 : 0;
+
### If these are changed, update @TYPES and the new() POD
use constant TGZ => 'tgz';
use constant TAR => 'tar';
@@ -851,7 +854,12 @@
### first, get the files.. it must be 2 different commands with 'unzip' :(
- { my $cmd = [ $self->bin_unzip, '-Z', '-1', $self->archive ];
+ { my $cmd;
+ if (ON_VMS) {
+ $cmd = [ $self->bin_unzip, '"-Z"', '-1', $self->archive ];
+ } else {
+ $cmd = [ $self->bin_unzip, '-Z', '-1', $self->archive ];
+ }
my $buffer = '';
unless( scalar run( command => $cmd,
==== //depot/perl/lib/Archive/Extract/t/01_Archive-Extract.t#5 (text) ====
Index: perl/lib/Archive/Extract/t/01_Archive-Extract.t
--- perl/lib/Archive/Extract/t/01_Archive-Extract.t#4~31288~ 2007-05-28
05:33:05.000000000 -0700
+++ perl/lib/Archive/Extract/t/01_Archive-Extract.t 2007-08-22
04:20:52.000000000 -0700
@@ -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;
End of Patch.