1 diff -cr ..\perl5os2.patch\perl5.001m.andy/installperl ./installperl
2 *** ../perl5os2.patch/perl5.001m.andy/installperl Wed Jun 21 12:09:26 1995
3 --- ./installperl Thu Sep 28 00:00:20 1995
6 # Read in the config file.
8 open(CONFIG, "config.sh") || die "You haven't run Configure yet!\n";
10 ! if (s/^(\w+=)/\$$1/) {
11 $accum =~ s/'undef'/undef/g;
19 # Read in the config file.
21 open(CONFIG, "config.sh") || die "You haven't run Configure yet!\n";
24 ! if (s/^(\w+=)/\$$1/ or not defined $_) {
25 $accum =~ s/'undef'/undef/g;
29 + last unless defined $_; # To get the last two lines too
35 -w $installbin || die "$installbin is not writable by you\n"
36 unless $installbin =~ m#^/afs/# || $nonono;
38 ! -x 'perl' || die "perl isn't executable!\n";
39 ! -x 'suidperl' || die "suidperl isn't executable!\n" if $d_dosuid;
41 -x 't/TEST' || warn "WARNING: You've never run 'make test'!!!",
42 " (Installing anyway.)\n";
44 -w $installbin || die "$installbin is not writable by you\n"
45 unless $installbin =~ m#^/afs/# || $nonono;
47 ! -x 'perl' . $exe_ext || die "perl isn't executable!\n";
48 ! -x 'suidperl' . $exe_ext|| die "suidperl isn't executable!\n" if $d_dosuid;
50 -x 't/TEST' || warn "WARNING: You've never run 'make test'!!!",
51 " (Installing anyway.)\n";
55 # First we install the version-numbered executables.
57 ! &safe_unlink("$installbin/perl$ver");
58 ! &cmd("cp perl $installbin/perl$ver");
60 ! &safe_unlink("$installbin/sperl$ver");
62 ! &cmd("cp suidperl $installbin/sperl$ver");
63 ! &chmod(04711, "$installbin/sperl$ver");
66 exit 0 if $versiononly;
69 # First we install the version-numbered executables.
71 ! &safe_unlink("$installbin/perl$ver$exe_ext");
72 ! &cmd("cp perl$exe_ext $installbin/perl$ver$exe_ext");
74 ! &safe_unlink("$installbin/sperl$ver$exe_ext");
76 ! &cmd("cp suidperl$exe_ext $installbin/sperl$ver$exe_ext");
77 ! &chmod(04711, "$installbin/sperl$ver$exe_ext");
80 exit 0 if $versiononly;
83 # Make links to ordinary names if installbin directory isn't current directory.
85 if (! &samepath($installbin, '.')) {
86 ! &safe_unlink("$installbin/perl", "$installbin/suidperl");
87 ! &link("$installbin/perl$ver", "$installbin/perl");
88 ! &link("$installbin/sperl$ver", "$installbin/suidperl") if $d_dosuid;
91 if (! &samepath($installbin, 'x2p')) {
92 ! &safe_unlink("$installbin/a2p");
93 ! &cmd("cp x2p/a2p $installbin/a2p");
94 ! &chmod(0755, "$installbin/a2p");
99 # Make links to ordinary names if installbin directory isn't current directory.
101 if (! &samepath($installbin, '.')) {
102 ! &safe_unlink("$installbin/perl$exe_ext", "$installbin/suidperl$exe_ext");
103 ! &link("$installbin/perl$ver$exe_ext", "$installbin/perl$exe_ext");
104 ! &link("$installbin/sperl$ver$exe_ext", "$installbin/suidperl$exe_ext")
108 if (! &samepath($installbin, 'x2p')) {
109 ! &safe_unlink("$installbin/a2p$exe_ext");
110 ! &cmd("cp x2p/a2p$exe_ext $installbin/a2p$exe_ext");
111 ! &chmod(0755, "$installbin/a2p$exe_ext");
117 if (-w $mainperldir && ! &samepath($mainperldir, $installbin) && !$nonono) {
118 # First make sure $mainperldir/perl is not already the same as
119 # the perl we just installed
120 ! if (-x "$mainperldir/perl") {
121 # Try to be clever about mainperl being a symbolic link
122 # to binexp/perl if binexp and installbin are different.
123 $mainperl_is_instperl =
124 ! &samepath("$mainperldir/perl", "$installbin/perl") ||
125 (($binexp ne $installbin) &&
126 ! (-l "$mainperldir/perl") &&
127 ! ((readlink "$mainperldir/perl") eq "$binexp/perl"));
129 if ((! $mainperl_is_instperl) &&
130 (&yn("Many scripts expect perl to be installed as " .
132 if (-w $mainperldir && ! &samepath($mainperldir, $installbin) && !$nonono) {
133 # First make sure $mainperldir/perl is not already the same as
134 # the perl we just installed
135 ! if (-x "$mainperldir/perl$exe_ext") {
136 # Try to be clever about mainperl being a symbolic link
137 # to binexp/perl if binexp and installbin are different.
138 $mainperl_is_instperl =
139 ! &samepath("$mainperldir/perl$exe_ext", "$installbin/perl$exe_ext") ||
140 (($binexp ne $installbin) &&
141 ! (-l "$mainperldir/perl$exe_ext") &&
142 ! ((readlink "$mainperldir/perl$exe_ext") eq "$binexp/perl$exe_ext"));
144 if ((! $mainperl_is_instperl) &&
145 (&yn("Many scripts expect perl to be installed as " .
148 "Do you wish to have $mainperldir/perl be the same as\n" .
149 "$binexp/perl? [y] ")))
151 ! unlink("$mainperldir/perl");
152 ! eval 'link("$installbin/perl", "$mainperldir/perl")' ||
153 ! eval 'symlink("$binexp/perl", "$mainperldir/perl")' ||
154 ! &cmd("cp $installbin/perl $mainperldir");
155 $mainperl_is_instperl = 1;
159 "Do you wish to have $mainperldir/perl be the same as\n" .
160 "$binexp/perl? [y] ")))
162 ! unlink("$mainperldir/perl$exe_ext");
163 ! eval 'link("$installbin/perl$exe_ext", "$mainperldir/perl$exe_ext")' ||
164 ! eval 'symlink("$binexp/perl$exe_ext", "$mainperldir/perl$exe_ext")' ||
165 ! &cmd("cp $installbin/perl$exe_ext $mainperldir$exe_ext");
166 $mainperl_is_instperl = 1;
171 # Also skip $mainperl if the user opted to have it be a link to the
174 ! @path = split(/:/, $ENV{"PATH"});
179 # Also skip $mainperl if the user opted to have it be a link to the
182 ! $dirsep = ($osname =~ m:^os/?2$:i) ? ';' : ':' ;
183 ! ($path = $ENV{"PATH"}) =~ s:\\:/:g ;
184 ! @path = split(/$dirsep/, $path);
190 # Use &samepath here because some systems have other dirs linked
191 # to $mainperldir (like SunOS)
192 next if ($mainperl_is_instperl && &samepath($_, $mainperldir));
193 ! push(@otherperls, "$_/perl") if (-x "$_/perl" && ! -d "$_/perl");
196 print STDERR "\nWarning: perl appears in your path in the following " .
198 # Use &samepath here because some systems have other dirs linked
199 # to $mainperldir (like SunOS)
200 next if ($mainperl_is_instperl && &samepath($_, $mainperldir));
201 ! push(@otherperls, "$_/perl$exe_ext")
202 ! if (-x "$_/perl$exe_ext" && ! -d "$_/perl$exe_ext");
205 print STDERR "\nWarning: perl appears in your path in the following " .
209 foreach $name (@names) {
210 next unless -e $name;
211 print STDERR " unlink $name\n";
212 + chmod 0777, $name if $osname =~ m:^os/?2$:i ;
213 unlink($name) || warn "Couldn't unlink $name: $!\n" unless $nonono;
219 next unless -e $name;
220 print STDERR " unlink $name\n";
222 + chmod 0777, $name if $osname =~ m:^os/?2$:i ;
223 next if unlink($name);
224 warn "Couldn't unlink $name: $!\n";
228 local($from,$to) = @_;
230 print STDERR " ln $from $to\n";
231 ! link($from,$to) || warn "Couldn't link $from to $to: $!\n" unless $nonono;
236 local($from,$to) = @_;
238 print STDERR " ln $from $to\n";
240 ! link($from,$to) || warn "Couldn't link $from to $to: $!\n" unless $nonono;
243 ! system( $cp, $from, $to )
244 ! && warn "Couldn't copy $from to $to: $!\n" unless $nonono;