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

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

Thread Previous | Thread Next
From:
Michael G Schwern
Date:
January 20, 2002 21:31
Subject:
Re: [PATCH] MakeMaker.pm sub-Makefile.PL tweak for VMS
Message ID:
20020121053141.GH30028@blackrider
On Sun, Jan 20, 2002 at 10:49:42PM -0600, Craig A. Berry wrote:
> Something recently broke our ability to build extensions that run a 
> Makefile.PL in a subdirectory, such as SDBM_File does.

Was this before or after I botched ExtUtils::MakeMaker::check_hints()?
ie. what patchlevel is this against?


> 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]

-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl Quality Assurance	    <perl-qa@perl.org>	       Kwalitee Is Job One
I knew right away that my pants and your inner child could be best friends.

Thread Previous | 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