From: Craig A. Berry Date: Mon, 15 Apr 2002 21:48:36 +0000 (-0500) Subject: s2p fix for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ae2b9a01756a2a2ea4071ab263cdb052d634e1a;p=p5sagit%2Fp5-mst-13.2.git s2p fix for VMS From: "Craig A. Berry" Message-Id: p4raw-id: //depot/perl@15941 --- diff --git a/configure.com b/configure.com index 14a2aaf..7dda531 100644 --- a/configure.com +++ b/configure.com @@ -5656,6 +5656,7 @@ $ WC "path_sep='|'" $ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm() $ WC "perladmin='" + perladmin + "'" $ WC "perllibs='" + perllibs + "'" +$ WC "perlpath='" + "''vms_prefix':[000000]Perl''ext'" + "'" $ WC "perl_symbol='" + perl_symbol + "'" ! VMS specific $ WC "perl_verb='" + perl_verb + "'" ! VMS specific $ WC "pgflquota='" + pgflquota + "'" diff --git a/t/x2p/s2p.t b/t/x2p/s2p.t index 15219fc..50d2483 100755 --- a/t/x2p/s2p.t +++ b/t/x2p/s2p.t @@ -789,6 +789,11 @@ my $plsed = "s2pt$$.pl"; # various command lines for my $s2p = File::Spec->catfile( File::Spec->updir(), 'x2p', 's2p' ); my $psed = File::Spec->catfile( File::Spec->curdir(), 'psed' ); +if ($^O eq 'VMS') { + # default in the .com extenson if it's not already there + $s2p = VMS::Filespec::rmsexpand($s2p, '.com'); + $psed = VMS::Filespec::rmsexpand($psed, '.com'); +} my $sedcmd = [ $psed, '-f', $script, $stdin ]; my $s2pcmd = [ $s2p, '-f', $script ]; my $plcmd = [ $plsed, $stdin ]; @@ -830,6 +835,10 @@ for my $tc ( sort keys %testcase ){ close( IN ) || goto FAIL_BOTH; } + # on VMS, runperl eats blank lines to work around + # spurious newlines in pipes + $testcase{$tc}{expect} =~ s/\n\n/\n/ if $^O eq 'VMS'; + # run and compare # $psedres = runperl( args => $sedcmd ); diff --git a/x2p/s2p.PL b/x2p/s2p.PL index 9a084f9..9b62caa 100644 --- a/x2p/s2p.PL +++ b/x2p/s2p.PL @@ -43,7 +43,7 @@ $Config{perlpath} print OUT <<'!NO!SUBS!'; -$0 =~ s/^.*?(\w+)$/$1/; +$0 =~ s/^.*?(\w+)[\.\w]*$/$1/; # (p)sed - a stream editor # History: Aug 12 2000: Original version. @@ -1795,7 +1795,7 @@ if( $doGenerate ){ #!$perlpath -w eval 'exec $perlpath -S \$0 \${1+"\$@"}' if 0; -\$0 =~ s/^.*?(\\w+)\$/\$1/; +\$0 =~ s/^.*?(\\w+)\[\\.\\w+\]*\$/\$1/; use strict; use Symbol;