On Thu, Nov 13, 2003 at 08:21:06PM -0800, David R. Morrison wrote:
> Log Message:
> Revise get_perl_dir_arch() and the places where it is used, correcting some 
> errors in UpdatePOD in case of Type: perl, and guaranteeing that the correct 
> perl command is used when needed.

Wedging another return value into get_perl_dir_arch() doesn't seem the best
of things to do here.  In fact, it already does too much already.  Instead, 
it looks like you need a get_perl() method.

Also, you've eliminated the $Config{archname} check.  Any reason?


> --- PkgVersion.pm     13 Nov 2003 23:53:43 -0000      1.169
> +++ PkgVersion.pm     14 Nov 2003 04:21:04 -0000      1.170
> @@ -132,18 +132,9 @@
>       # percent-expansions
>       if ($self->param("_type") eq "perl") {
>               # grab perl version, if present
> -             my $perlversion = get_system_perl_version();
> -             my ($perldirectory, $perlarchdir) = $self->get_perl_dir_arch();
> +             my ($perldirectory, $perlarchdir,$perlcmd) = 
> $self->get_perl_dir_arch();
>  
> -             ### PERL= needs a full path or you end up with
> -             ### perlmods trying to run ../perl$perlversion
> -             my $pathnperlver = get_path('perl'.$perlversion);
> -             ### if perl$perlversion doesn't exist set it to old method
> -             ### this happens on 10.3 since there is nolonger a perl5.6.0
> -             unless ($pathnperlver) {
> -                     $pathnperlver = "perl".$perlversion;
> -             }
> -             $configure_params = "PERL=$pathnperlver PREFIX=\%p 
> INSTALLPRIVLIB=\%p/lib/perl5$perldirectory 
> INSTALLARCHLIB=\%p/lib/perl5$perldirectory/$perlarchdir 
> INSTALLSITELIB=\%p/lib/perl5$perldirectory 
> INSTALLSITEARCH=\%p/lib/perl5$perldirectory/$perlarchdir 
> INSTALLMAN1DIR=\%p/share/man/man1 INSTALLMAN3DIR=\%p/share/man/man3 
> INSTALLSITEMAN1DIR=\%p/share/man/man1 INSTALLSITEMAN3DIR=\%p/share/man/man3 
> INSTALLBIN=\%p/bin INSTALLSITEBIN=\%p/bin INSTALLSCRIPT=\%p/bin ".
> +             $configure_params = "PERL=$perlcmd PREFIX=\%p 
> INSTALLPRIVLIB=\%p/lib/perl5$perldirectory 
> INSTALLARCHLIB=\%p/lib/perl5$perldirectory/$perlarchdir 
> INSTALLSITELIB=\%p/lib/perl5$perldirectory 
> INSTALLSITEARCH=\%p/lib/perl5$perldirectory/$perlarchdir 
> INSTALLMAN1DIR=\%p/share/man/man1 INSTALLMAN3DIR=\%p/share/man/man3 
> INSTALLSITEMAN1DIR=\%p/share/man/man1 INSTALLSITEMAN3DIR=\%p/share/man/man3 
> INSTALLBIN=\%p/bin INSTALLSITEBIN=\%p/bin INSTALLSCRIPT=\%p/bin ".
>                       $self->param_default("ConfigureParams", "");
>       } else {
>               $configure_params = "--prefix=\%p ".
> @@ -1309,10 +1300,7 @@
>               $compile_script = $self->param("CompileScript");
>       } else {
>               if ($self->param("_type") eq "perl") {
> -                     my $perlcmd = "/usr/bin/perl";
> -                     if ($self->has_param("_perlversion")) {
> -                             $perlcmd = 'perl' . $self->param("_perlversion");
> -                     }
> +                 my ($perldirectory, $perlarchdir,$perlcmd) = 
> $self->get_perl_dir_arch();
>                       $compile_script =
>                               "$perlcmd Makefile.PL \%c\n".
>                               "make\n";
> @@ -2096,34 +2084,25 @@
>       my $self = shift;
>  
>       # grab perl version, if present
> -     my $perlversion   = get_system_perl_version();
> +     my $perlversion   = "";
> +#get_system_perl_version();
>       my $perldirectory = "";
>       my $perlarchdir;
>       if ($self->has_param("_perlversion")) {
>               $perlversion = $self->param("_perlversion");
> -     }
> -     $perldirectory = "/" . $perlversion;
> +             $perldirectory = "/" . $perlversion;
> +         }
> +     ### PERL= needs a full path or you end up with
> +     ### perlmods trying to run ../perl$perlversion
>       my $perlcmd = get_path('perl'.$perlversion);
>  
> -     if (defined $perlcmd and $perlcmd ne "" and -x $perlcmd and 
> -            open(ARCHNAME, 
> -             qq{$perlcmd -MConfig -e 'print \$Config{archname}' 2>/dev/null |}) ) 
> -        {
> -             $perlarchdir = <ARCHNAME>;
> -             close(ARCHNAME);
> -     }
> -
> -     # if we can't get it from perl (perhaps because it's not installed yet)
> -     # then we guess, based on the version (this is the old behavior)
> -     if (not defined $perlarchdir or $perlarchdir eq "") {
>               if ($perlversion ge "5.8.1") {
>                       $perlarchdir = 'darwin-thread-multi-2level';
>               } else {
>                       $perlarchdir = 'darwin';
>               }
> -     }
>  
> -     return ($perldirectory, $perlarchdir);
> +     return ($perldirectory, $perlarchdir,$perlcmd);
>  }
>  
>  ### EOF

-- 
Michael G Schwern        [EMAIL PROTECTED]  http://www.pobox.com/~schwern/
I've just gone through a lung-crushing breakup with my blender and I don't 
think I should screw my forehead alone tonight.


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to