aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2002-06-09 11:24:22 +0000
committerDoug Barton <dougb@FreeBSD.org>2002-06-09 11:24:22 +0000
commit3c1a97543ca8b1cbc1cb0e4560b134c07d34636f (patch)
tree2bf503ca4f2c08e87ac589e96b22502ce7cb0ad0
parent1b6982e0b5edf0b2038c2aa25a5e395c68da4e5a (diff)
downloadports-3c1a97543ca8b1cbc1cb0e4560b134c07d34636f.tar.gz
ports-3c1a97543ca8b1cbc1cb0e4560b134c07d34636f.zip
Update to better handle life as it is now in -current.
Approved by: tobez (MAINTAINER)
Notes
Notes: svn path=/head/; revision=60961
-rw-r--r--lang/perl5.10/files/use.perl35
-rw-r--r--lang/perl5.12/files/use.perl35
-rw-r--r--lang/perl5.14/files/use.perl35
-rw-r--r--lang/perl5.16/files/use.perl35
-rw-r--r--lang/perl5.6/files/use.perl35
-rw-r--r--lang/perl5.8/files/use.perl35
-rw-r--r--lang/perl5/files/use.perl35
7 files changed, 182 insertions, 63 deletions
diff --git a/lang/perl5.10/files/use.perl b/lang/perl5.10/files/use.perl
index 08cef70c7ab3..557e38b52311 100644
--- a/lang/perl5.10/files/use.perl
+++ b/lang/perl5.10/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;
diff --git a/lang/perl5.12/files/use.perl b/lang/perl5.12/files/use.perl
index 08cef70c7ab3..557e38b52311 100644
--- a/lang/perl5.12/files/use.perl
+++ b/lang/perl5.12/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;
diff --git a/lang/perl5.14/files/use.perl b/lang/perl5.14/files/use.perl
index 08cef70c7ab3..557e38b52311 100644
--- a/lang/perl5.14/files/use.perl
+++ b/lang/perl5.14/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;
diff --git a/lang/perl5.16/files/use.perl b/lang/perl5.16/files/use.perl
index 08cef70c7ab3..557e38b52311 100644
--- a/lang/perl5.16/files/use.perl
+++ b/lang/perl5.16/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;
diff --git a/lang/perl5.6/files/use.perl b/lang/perl5.6/files/use.perl
index 08cef70c7ab3..557e38b52311 100644
--- a/lang/perl5.6/files/use.perl
+++ b/lang/perl5.6/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;
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;
diff --git a/lang/perl5/files/use.perl b/lang/perl5/files/use.perl
index 08cef70c7ab3..557e38b52311 100644
--- a/lang/perl5/files/use.perl
+++ b/lang/perl5/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;