perl 5.002beta1h patch: Configure
[p5sagit/p5-mst-13.2.git] / os2 / diff.installperl
CommitLineData
4633a7c4 1diff -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
4***************
5*** 24,35 ****
6 # Read in the config file.
7
8 open(CONFIG, "config.sh") || die "You haven't run Configure yet!\n";
9! while (<CONFIG>) {
10! if (s/^(\w+=)/\$$1/) {
11 $accum =~ s/'undef'/undef/g;
12 eval $accum;
13 $accum = '';
14 }
15 $accum .= $_;
16 }
17 close CONFIG;
18--- 24,37 ----
19 # Read in the config file.
20
21 open(CONFIG, "config.sh") || die "You haven't run Configure yet!\n";
22! while (1) {
23! $_ = <CONFIG>;
24! if (s/^(\w+=)/\$$1/ or not defined $_) {
25 $accum =~ s/'undef'/undef/g;
26 eval $accum;
27 $accum = '';
28 }
29+ last unless defined $_; # To get the last two lines too
30 $accum .= $_;
31 }
32 close CONFIG;
33***************
34*** 50,57 ****
35 -w $installbin || die "$installbin is not writable by you\n"
36 unless $installbin =~ m#^/afs/# || $nonono;
37
38! -x 'perl' || die "perl isn't executable!\n";
39! -x 'suidperl' || die "suidperl isn't executable!\n" if $d_dosuid;
40
41 -x 't/TEST' || warn "WARNING: You've never run 'make test'!!!",
42 " (Installing anyway.)\n";
43--- 52,59 ----
44 -w $installbin || die "$installbin is not writable by you\n"
45 unless $installbin =~ m#^/afs/# || $nonono;
46
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;
49
50 -x 't/TEST' || warn "WARNING: You've never run 'make test'!!!",
51 " (Installing anyway.)\n";
52***************
53*** 69,81 ****
54
55 # First we install the version-numbered executables.
56
57! &safe_unlink("$installbin/perl$ver");
58! &cmd("cp perl $installbin/perl$ver");
59
60! &safe_unlink("$installbin/sperl$ver");
61 if ($d_dosuid) {
62! &cmd("cp suidperl $installbin/sperl$ver");
63! &chmod(04711, "$installbin/sperl$ver");
64 }
65
66 exit 0 if $versiononly;
67--- 71,83 ----
68
69 # First we install the version-numbered executables.
70
71! &safe_unlink("$installbin/perl$ver$exe_ext");
72! &cmd("cp perl$exe_ext $installbin/perl$ver$exe_ext");
73
74! &safe_unlink("$installbin/sperl$ver$exe_ext");
75 if ($d_dosuid) {
76! &cmd("cp suidperl$exe_ext $installbin/sperl$ver$exe_ext");
77! &chmod(04711, "$installbin/sperl$ver$exe_ext");
78 }
79
80 exit 0 if $versiononly;
81***************
82*** 83,97 ****
83 # Make links to ordinary names if installbin directory isn't current directory.
84
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;
89 }
90
91 if (! &samepath($installbin, 'x2p')) {
92! &safe_unlink("$installbin/a2p");
93! &cmd("cp x2p/a2p $installbin/a2p");
94! &chmod(0755, "$installbin/a2p");
95 }
96
97 # Install scripts.
98--- 85,100 ----
99 # Make links to ordinary names if installbin directory isn't current directory.
100
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")
105! if $d_dosuid;
106 }
107
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");
112 }
113
114 # Install scripts.
115***************
116*** 174,187 ****
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"));
128 }
129 if ((! $mainperl_is_instperl) &&
130 (&yn("Many scripts expect perl to be installed as " .
131--- 177,190 ----
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"));
143 }
144 if ((! $mainperl_is_instperl) &&
145 (&yn("Many scripts expect perl to be installed as " .
146***************
147*** 189,198 ****
148 "Do you wish to have $mainperldir/perl be the same as\n" .
149 "$binexp/perl? [y] ")))
150 {
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;
156 }
157 }
158--- 192,201 ----
159 "Do you wish to have $mainperldir/perl be the same as\n" .
160 "$binexp/perl? [y] ")))
161 {
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;
167 }
168 }
169***************
170*** 203,209 ****
171 # Also skip $mainperl if the user opted to have it be a link to the
172 # installed perl.
173
174! @path = split(/:/, $ENV{"PATH"});
175 @otherperls = ();
176 for (@path) {
177 next unless m,^/,;
178--- 206,214 ----
179 # Also skip $mainperl if the user opted to have it be a link to the
180 # installed perl.
181
182! $dirsep = ($osname =~ m:^os/?2$:i) ? ';' : ':' ;
183! ($path = $ENV{"PATH"}) =~ s:\\:/:g ;
184! @path = split(/$dirsep/, $path);
185 @otherperls = ();
186 for (@path) {
187 next unless m,^/,;
188***************
189*** 211,217 ****
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");
194 }
195 if (@otherperls) {
196 print STDERR "\nWarning: perl appears in your path in the following " .
197--- 216,223 ----
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");
203 }
204 if (@otherperls) {
205 print STDERR "\nWarning: perl appears in your path in the following " .
206***************
207*** 244,249 ****
208--- 250,256 ----
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;
214 }
215 }
216***************
217*** 255,260 ****
218--- 262,268 ----
219 next unless -e $name;
220 print STDERR " unlink $name\n";
221 next if $nonono;
222+ chmod 0777, $name if $osname =~ m:^os/?2$:i ;
223 next if unlink($name);
224 warn "Couldn't unlink $name: $!\n";
225 if ($! =~ /busy/i) {
226***************
227*** 290,296 ****
228 local($from,$to) = @_;
229
230 print STDERR " ln $from $to\n";
231! link($from,$to) || warn "Couldn't link $from to $to: $!\n" unless $nonono;
232 }
233
234 sub chmod {
235--- 298,310 ----
236 local($from,$to) = @_;
237
238 print STDERR " ln $from $to\n";
239! eval {
240! link($from,$to) || warn "Couldn't link $from to $to: $!\n" unless $nonono;
241! };
242! if ($@) {
243! system( $cp, $from, $to )
244! && warn "Couldn't copy $from to $to: $!\n" unless $nonono;
245! }
246 }
247
248 sub chmod {