summaryrefslogtreecommitdiff
path: root/lang/perl5.6/files
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@FreeBSD.org>2002-12-04 16:50:04 +0000
committerBruce A. Mah <bmah@FreeBSD.org>2002-12-04 16:50:04 +0000
commit80afc7818f699f0c2bd3c1164f9c8d88ea85ef19 (patch)
tree61334614ae3ac483566764e7a348012fe4e2e41a /lang/perl5.6/files
parentCorrect pkg-comment. (diff)
On recent 5-CURRENT, there is no Perl wrapper. It is therefore possible
that /usr/bin/perl5 doesn't exist, which violates some of use.perl's assumptions. Take care of this case. [1] Also in the case of a recent 5-CURRENT, automatically perform "use.perl port" during package/port installation. This helps the installation of sysinstall's new "Perl distribution", in that sysinstall doesn't need to do this explicitly as Yet Another Special Case. [2] PORTREVISION bump after all this good stuff. Requested by: bmah [1], jhb [2] Submitted by: tobez (port MAINTAINER) Approved by: portmgr (kris)
Notes
Notes: svn path=/head/; revision=71365
Diffstat (limited to 'lang/perl5.6/files')
-rw-r--r--lang/perl5.6/files/use.perl18
1 files changed, 13 insertions, 5 deletions
diff --git a/lang/perl5.6/files/use.perl b/lang/perl5.6/files/use.perl
index bed88bd46d44..0853b08da0a4 100644
--- a/lang/perl5.6/files/use.perl
+++ b/lang/perl5.6/files/use.perl
@@ -17,8 +17,6 @@ EOF
my $port_perl = '%%PREFIX%%/bin/perl';
$port_perl =~ tr|/|/|s;
-my $ident = `/usr/bin/ident -q /usr/bin/perl5`;
-
@ARGV == 1 or usage();
if ($ARGV[0] eq 'port') {
switch_to_port();
@@ -43,6 +41,7 @@ sub switch_to_system
link '/usr/bin/perl5', '/usr/bin/perl';
link '/usr/bin/perl5', '/usr/bin/perl%%PERL_VERSION%%';
+ my $ident = `/usr/bin/ident -q /usr/bin/perl5`;
if ($ident =~ m#src/usr.bin/perl/perl.c#) {
link '/usr/bin/perl5', '/usr/bin/suidperl';
} else {
@@ -81,10 +80,18 @@ sub switch_to_port
{
# protect against cases where people use PREFIX=/usr
if ($port_perl ne '/usr/bin/perl') {
- if ($ident =~ m#src/usr.bin/perl/perl.c#) {
- rename '/usr/bin/perl', '/usr/bin/perl-wrapper';
+
+ my $need_perl5_link;
+ if (-e "/usr/bin/perl5" && !-l "/usr/bin/perl5") {
+ my $ident = `/usr/bin/ident -q /usr/bin/perl5`;
+ if ($ident =~ m#src/usr.bin/perl/perl.c#) {
+ rename '/usr/bin/perl', '/usr/bin/perl-wrapper';
+ } else {
+ unlink '/usr/bin/perl';
+ }
} else {
- unlink '/usr/bin/perl';
+ unlink "/usr/bin/perl5";
+ $need_perl5_link = 1;
}
unlink '/usr/bin/suidperl', '/usr/bin/perl%%PERL_VERSION%%';
@@ -92,6 +99,7 @@ sub switch_to_port
symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl';
symlink '%%PREFIX%%/bin/suidperl', '/usr/bin/suidperl';
symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl%%PERL_VERSION%%';
+ symlink '%%PREFIX%%/bin/perl', '/usr/bin/perl5' if $need_perl5_link;
}
open MK, ">> /etc/make.conf" or die "/etc/make.conf: $!";