diff options
author | Doug Barton <dougb@FreeBSD.org> | 2002-06-09 11:24:22 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2002-06-09 11:24:22 +0000 |
commit | 3c1a97543ca8b1cbc1cb0e4560b134c07d34636f (patch) | |
tree | 2bf503ca4f2c08e87ac589e96b22502ce7cb0ad0 /lang/perl5.8/files | |
parent | Try grouping of MASTER_SITES (diff) |
Update to better handle life as it is now in -current.
Approved by: tobez (MAINTAINER)
Diffstat (limited to 'lang/perl5.8/files')
-rw-r--r-- | lang/perl5.8/files/use.perl | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/lang/perl5.8/files/use.perl b/lang/perl5.8/files/use.perl index 08cef70c7ab3..557e38b52311 100644 --- a/lang/perl5.8/files/use.perl +++ b/lang/perl5.8/files/use.perl @@ -14,6 +14,11 @@ EOF exit 2; } +my $port_perl = '%%PREFIX%%/bin/perl'; +$port_perl =~ tr|/|/|s; + +my $ident = `/usr/bin/ident /usr/bin/perl5`; + @ARGV == 1 or usage(); if ($ARGV[0] eq 'port') { switch_to_port(); @@ -24,18 +29,25 @@ if ($ARGV[0] eq 'port') { } exit 0; +# Both functions depend on the idea that switch_to_port leaves +# perl5 alone. If the wrapper is installed on a -current system, +# /usr/bin/perl5 will also be the wrapper. + sub switch_to_system { - my $port_perl = '%%PREFIX%%/bin/perl'; - $port_perl =~ tr|/|/|s; - # protect against cases where people use PREFIX=/usr if ($port_perl ne '/usr/bin/perl') { unlink '/usr/bin/perl', '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%'; link '/usr/bin/perl5', '/usr/bin/perl'; - link '/usr/bin/sperl5', '/usr/bin/suidperl'; + link '/usr/bin/perl5', '/usr/bin/perl%%PERL_VERSION%%'; + + if ($ident =~ m#src/usr.bin/perl/perl.c#) { + link '/usr/bin/perl5', '/usr/bin/suidperl'; + } else { + link '/usr/bin/sperl5', '/usr/bin/suidperl'; + } } open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!"; @@ -47,6 +59,7 @@ sub switch_to_system .undef PERL_VERSION .undef PERL_ARCH .undef NOPERL +.undef NO_PERL EOF close MK; @@ -54,13 +67,15 @@ EOF sub switch_to_port { - my $port_perl = '%%PREFIX%%/bin/perl'; - $port_perl =~ tr|/|/|s; - # protect against cases where people use PREFIX=/usr if ($port_perl ne '/usr/bin/perl') { - unlink '/usr/bin/perl', '/usr/bin/suidperl', - '/usr/bin/perl%%PERL_VERSION%%'; + if ($ident =~ m#src/usr.bin/perl/perl.c#) { + rename '/usr/bin/perl', '/usr/bin/perl-wrapper'; + } else { + unlink '/usr/bin/perl'; + } + + unlink '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%'; symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl'; symlink '%%PREFIX%%/bin/suidperl', '/usr/bin/suidperl'; @@ -76,6 +91,8 @@ PERL_VER=%%PERL_VER%% PERL_VERSION=%%PERL_VERSION%% PERL_ARCH=%%PERL_ARCH%% NOPERL=yo +NO_PERL=yo +NO_PERL_WRAPPER=yo EOF close MK; |