develooper Front page | perl.vmsperl | Postings from January 2002

[PATCH] MakeMaker.pm sub-Makefile.PL tweak for VMS

Thread Next
From:
Craig A. Berry
Date:
January 20, 2002 20:49
Subject:
[PATCH] MakeMaker.pm sub-Makefile.PL tweak for VMS
Message ID:
a05101004b8714273d60c@[172.16.52.1]
Something recently broke our ability to build extensions that run a 
Makefile.PL in a subdirectory, such as SDBM_File does.  I found and 
fixed the problem code (patch below) but I can't see how the 
existing code ever worked nor what broke it.  The only thing I can 
think of is that there was a scoping leak that compensated for 
another bug and the fact that we now run the subsidiary Makefile.PL
using "do" plugged the scoping leak and exposed the other bug (which 
had to do with the fact that a command verb tests positive as an 
absolute filename).


--- lib/ExtUtils/MakeMaker.pm;-0	Wed Jan 16 08:42:52 2002
+++ lib/ExtUtils/MakeMaker.pm	Sun Jan 20 21:20:57 2002
@@ -406,12 +406,20 @@
 	for $key (keys %Prepend_dot_dot) {
 	    next unless defined $self->{PARENT}{$key};
 	    $self->{$key} = $self->{PARENT}{$key};
-		# PERL and FULLPERL may be command verbs instead of full
-		# file specifications under VMS.  If so, don't turn them
-		# into a filespec.
-	    $self->{$key} = $self->catdir("..",$self->{$key})
-		unless $self->file_name_is_absolute($self->{$key})
-		|| ($^O eq 'VMS' and ($key =~ /PERL$/ && $self->{$key} =~ /^[\w\-\$]+$/));
+	    unless ($^O eq 'VMS' && $key =~ /PERL$/) {
+	        $self->{$key} = $self->catdir("..",$self->{$key})
+		    unless $self->file_name_is_absolute($self->{$key});
+	    } else {
+		# PERL or FULLPERL will be a command verb or even a command with 
+		# an argument instead of a full file specification under VMS.  So, 
+		# don't turn the command into a filespec, but do add a level to the 
+		# path of the argument if not already absolute.
+
+		my @cmd = split /\s+/, $self->{$key};
+		$cmd[1] = $self->catfile('[-]',$cmd[1])
+		    unless (scalar(@cmd) < 2 || $self->file_name_is_absolute($cmd[1]));
+		$self->{$key} = join(' ', @cmd);
+	    }
 	}
 	if ($self->{PARENT}) {
 	    $self->{PARENT}->{CHILDREN}->{$newclass} = $self;
[end of patch]
-- 
________________________________________
Craig A. Berry
mailto:craigberry@mac.com

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About