summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/installperl
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2019-02-13 21:15:00 +0000
committerafresh1 <afresh1@openbsd.org>2019-02-13 21:15:00 +0000
commit9f11ffb7133c203312a01e4b986886bc88c7d74b (patch)
tree6618511204c614b20256e4ef9dea39a7b311d638 /gnu/usr.bin/perl/installperl
parentImport perl-5.28.1 (diff)
downloadwireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.tar.xz
wireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.zip
Fix merge issues, remove excess files - match perl-5.28.1 dist
looking good sthen@, Great! bluhm@
Diffstat (limited to 'gnu/usr.bin/perl/installperl')
-rw-r--r--gnu/usr.bin/perl/installperl116
1 files changed, 19 insertions, 97 deletions
diff --git a/gnu/usr.bin/perl/installperl b/gnu/usr.bin/perl/installperl
index 452dd2efd8b..3bf79d2d6fc 100644
--- a/gnu/usr.bin/perl/installperl
+++ b/gnu/usr.bin/perl/installperl
@@ -11,8 +11,8 @@ BEGIN {
}
use strict;
-use vars qw($Is_VMS $Is_W32 $Is_OS2 $Is_Cygwin $Is_Darwin $Is_NetWare $Is_AmigaOS
- %opts $packlist);
+our ($Is_VMS, $Is_W32, $Is_OS2, $Is_Cygwin, $Is_Darwin, $Is_NetWare, $Is_AmigaOS,
+ %opts, $packlist);
my $versiononly;
BEGIN {
@@ -77,8 +77,8 @@ $opts{destdir} = '';
my $usage = 0;
if (!GetOptions(\%opts, 'notify|n', 'strip|s', 'silent|S',
'skip-otherperls|o', 'force|f', 'verbose|V', 'archname|A',
- 'netware', 'nopods|p', 'destdir:s', 'help|h|?', 'user|u:s',
- 'group|g:s', 'versiononly|v' => \$versiononly, '<>' => sub {
+ 'netware', 'nopods|p', 'destdir:s', 'help|h|?',
+ 'versiononly|v' => \$versiononly, '<>' => sub {
if ($_[0] eq '+v') {
$versiononly = 0;
} else {
@@ -107,8 +107,6 @@ Usage $0: [switches]
-A Also install perl with the architecture's name in the perl binary's
name.
-p Don't install the pod files. [This will break use diagnostics;]
- -g group install files with the specified group
- -u user install files with the specified user
-netware Install correctly on a Netware server.
-destdir Prefix installation directories by this string.
-h Display this help message.
@@ -116,8 +114,6 @@ EOT
exit $usage;
}
}
-$opts{'uid'} = getpwnam($opts{'user'}) if exists($opts{'user'});
-$opts{'gid'} = getgrnam($opts{'group'}) if exists($opts{'group'});
$versiononly = 1 if $Config{versiononly} && !defined $versiononly;
my (@scripts, @tolink);
@@ -157,7 +153,7 @@ if ((-e "testcompile") && (defined($ENV{'COMPILE'}))) {
}
# Exclude nonxs extensions that are not architecture dependent
-my @nonxs = grep(!/^(Errno|IO\/Compress)$/, split(' ', $Config{'nonxs_ext'}));
+my @nonxs = grep(!/^Errno$/, split(' ', $Config{'nonxs_ext'}));
my @ext_dirs = qw(cpan dist ext);
foreach my $ext_dir (@ext_dirs) {
@@ -203,7 +199,7 @@ my $installprivlib = "$opts{destdir}$Config{installprivlib}";
my $installarchlib = "$opts{destdir}$Config{installarchlib}";
my $installsitelib = "$opts{destdir}$Config{installsitelib}";
my $installsitearch = "$opts{destdir}$Config{installsitearch}";
-my $installman1dir = "none";
+my $installman1dir = "$opts{destdir}$Config{installman1dir}";
my $man1ext = $Config{man1ext};
my $libperl = $Config{libperl};
# Shared library and dynamic loading suffixes.
@@ -243,6 +239,8 @@ if ($Is_VMS) { # Hang in there until File::Spec hits the big time
$installbin || die "No installbin directory in config.sh\n";
-d $installbin || mkpath($installbin);
-d $installbin || $opts{notify} || die "$installbin is not a directory\n";
+-w $installbin || $opts{notify} || die "$installbin is not writable by you\n"
+ unless $installbin =~ m#^/afs/# || $opts{notify};
if (!$Is_NetWare) {
if (!$Is_VMS) {
@@ -255,9 +253,9 @@ else {
}
}
-#-f 't/rantests' || $Is_W32
-# || warn "WARNING: You've never run 'make test' or",
-# " some tests failed! (Installing anyway.)\n";
+-f 't/rantests' || $Is_W32
+ || warn "WARNING: You've never run 'make test' or",
+ " some tests failed! (Installing anyway.)\n";
} #if (!$Is_NetWare)
# This will be used to store the packlist
@@ -283,10 +281,6 @@ if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin) {
$packlist->{"$Config{installbin}/$perldll"} = { type => 'file' };
} # if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin)
-# Get the install command and flags from the environment
-my @installcmd = $ENV{"INSTALL"} || "install";
-push(@installcmd, $ENV{"INSTALL_COPY"} || "-c");
-
# First we install the version-numbered executables.
if ($Is_VMS) {
@@ -307,8 +301,10 @@ if ($Is_VMS) {
}
elsif ($^O ne 'dos') {
if (!$Is_NetWare) {
- my $ver = ''; # don't install a versioned perl binary
- install("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext", "0755");
+ safe_unlink("$installbin/$perl_verbase$ver$exe_ext");
+ copy("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext");
+ strip("$installbin/$perl_verbase$ver$exe_ext");
+ chmod(0755, "$installbin/$perl_verbase$ver$exe_ext");
}
else {
# If installing onto a NetWare server
@@ -381,9 +377,7 @@ elsif ($Is_Cygwin) { # On Cygwin symlink it to CORE to make Makefile happy
@corefiles = <*.h>;
} else {
# [als] hard-coded 'libperl' name... not good!
- #@corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
- @corefiles = <*.h *.inc perl*$Config{lib_ext}>;
- push(@corefiles,<libperl*.*>) unless defined($ENV{"NOLIBINSTALL"});
+ @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
# AIX needs perl.exp installed as well.
push(@corefiles,'perl.exp') if $^O eq 'aix';
@@ -411,8 +405,7 @@ if ($Is_W32) { #linking lib isn't made in root but in CORE on Win32
# Install main perl executables
# Make links to ordinary names if installbin directory isn't current directory.
-if (0) { # don't install a versioned perl binary
-#if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS && ! $Is_NetWare) {
+if (! $versiononly && ! samepath($installbin, '.') && ($^O ne 'dos') && ! $Is_VMS && ! $Is_NetWare) {
safe_unlink("$installbin/$perl$exe_ext", "$installbin/suid$perl$exe_ext");
if ($^O eq 'vos') {
# VOS doesn't support hard links, so use a symlink.
@@ -548,54 +541,8 @@ if (!$opts{nopods} && (!$versiononly || ($installprivlib =~ m/\Q$vershort/))) {
}
-# Check to make sure there aren't other perls around in installer's
-# path. This is probably UNIX-specific. Check all absolute directories
-# in the path except for where public executables are supposed to live.
-# Also skip $mainperl if the user opted to have it be a link to the
-# installed perl.
-
-if (!$versiononly && !$opts{'skip-otherperls'}) {
- my ($path, @path);
- my $dirsep = ($Is_OS2 || $Is_W32 || $Is_NetWare) ? ';' : ':' ;
- ($path = $ENV{"PATH"}) =~ s:\\:/:g ;
- @path = split(/$dirsep/, $path);
- if ($Is_VMS) {
- my $i = 0;
- while (exists $ENV{'DCL$PATH' . $i}) {
- my $dir = unixpath($ENV{'DCL$PATH' . $i}); $dir =~ s-/$--;
- push(@path,$dir);
- }
- }
- my @otherperls;
- my %otherperls;
- for (@path) {
- next unless m,^/,;
- # Use &samepath here because some systems have other dirs linked
- # to $mainperldir (like SunOS)
- next unless -d;
- next if samepath($_, $binexp);
- next if samepath($_, cwd());
- next if ($mainperl_is_instperl && samepath($_, $mainperldir));
- my $otherperl = "$_/$perl$exe_ext";
- next if $otherperls{$otherperl}++;
- push(@otherperls, $otherperl)
- if (-x $otherperl && ! -d $otherperl);
- }
- if (@otherperls) {
- warn "\nWarning: $perl appears in your path in the following " .
- "locations beyond where\nwe just installed it:\n";
- for (@otherperls) {
- warn " ", $_, "\n";
- }
- warn "\n";
- }
-
-}
$packlist->write() unless $opts{notify};
-if (defined($opts{uid}) || defined($opts{gid})) {
- chown($opts{uid}, $opts{gid}, $packlist->packlist_file());
-}
print " Installation complete\n" if $opts{verbose};
exit 0;
@@ -634,7 +581,6 @@ sub safe_unlink {
sub copy {
my($from,$to) = @_;
- my($success) = 0;
my $xto = $to;
$xto =~ s/^\Q$opts{destdir}\E//;
@@ -642,35 +588,15 @@ sub copy {
unless $opts{silent};
print " creating new version of $xto\n"
if $Is_VMS and -e $to and !$opts{silent};
- unless ($opts{notify} or File::Copy::copy($from, $to) and ++$success) {
+ unless ($opts{notify} or File::Copy::copy($from, $to)) {
# Might have been that F::C::c can't overwrite the target
warn "Couldn't copy $from to $to: $!\n"
unless -f $to and (chmod(0666, $to), unlink $to)
- and File::Copy::copy($from, $to) and ++$success;
- }
- if (defined($opts{uid}) || defined($opts{gid})) {
- chown($opts{uid}, $opts{gid}, $to) if $success;
+ and File::Copy::copy($from, $to);
}
$packlist->{$xto} = { type => 'file' };
}
-sub install {
- my($from,$to,$mode) = @_;
-
- my $xto = $to;
- my $cmd = join(' ', @installcmd);
- $cmd .= " -m $mode" if $mode;
- $cmd .= " -o $opts{uid}" if defined($opts{uid});
- $cmd .= " -g $opts{gid}" if defined($opts{gid});
- $cmd .= " -s" if $opts{strip};
- $cmd .= " $from $to";
- $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
- print $opts{verbose} ? " install $from $xto\n" : " $xto\n" unless $opts{silent};
- system($cmd);
- warn "Couldn't $cmd\n" if $?;
- $packlist->{$xto} = { type => 'file' };
-}
-
sub installlib {
my $dir = $File::Find::dir;
$dir =~ s!\Alib/?!!;
@@ -699,10 +625,6 @@ sub installlib {
return;
}
- # If we have different install version, install that instead
- return if -e "$_.install";
- $name =~ s/\.install$//;
-
# ignore patch backups, RCS files, emacs backup & temp files and the
# .exists files, .PL files, and test files.
return if $name =~ m{\.orig$|\.rej$|~$|^#.+#$|,v$|^\.exists|\.PL$|\.plc$|\.t$|^test\.pl$|^dbm_filter_util\.pl$|^filter-util\.pl$|^uupacktool\.pl$|^\.gitignore$} ||