diff options
author | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1995-06-22 00:43:21 +0000 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1995-06-22 00:43:21 +0000 |
commit | e50aee73b3d4c555c37e4b4a16694765fb16c887 (patch) | |
tree | 46b50fff5f53a49b55d0ff3f4e1816e427264375 /installperl | |
parent | 4aa0a1f7324b8447469670a1b2427c3ac2428bae (diff) | |
download | perl-e50aee73b3d4c555c37e4b4a16694765fb16c887.tar.gz |
This is my patch patch.1m for perl5.001.
To apply, change to your perl directory, run the command above, then
apply with
patch -p1 -N < thispatch.
Highlights of this patch include:
1. Fixes for $sitelib, $d_stdio_ptr_lval, and $d_stdio_cnt_lval
when config.sh is re-used.
2. Move embed.h, keywords.h, and opcode.h dependencies to
a special regen_headers target that is ordinarily not used.
This is now analogous to the run_byacc target. As a cosmetic
side-effect, I transliterated embed_h.sh into embed.pl so that
it can run on non-unix systems as well.
3. Tests for gdbm_{sync,exists,setopt} in GDBM_File (needed for
Slackware 2.1).
For good measure, I've also thrown in the following patches I pulled
off the list, mostly unmodified from the originals.
1. Larry's "unofficial official" fix for the subroutine array context
problem.
2. Tim's __DATA__ patch. (I kept forgetting about this one.)
3. Malcom's USE_OP_MASK patch to pave the way for his Safe extension.
4. Spider's suggested renaming of regexec to pregexec and regcomp to
pregcomp to avoid conflicts with POSIX symbols on Digital Unix.
(I only added a brief explanatory comment to the relevant .c
files.)
5. Spider's installperl patch to avoid installing *.orig and and the
.exists files. (I changed this a little to include patch's ~
suffix, which is used on systems with short file names (in some
versions of patch)).
6. Raphael's "safe_unlink" patch to installperl, in case a copy
of perl is currently runniung.
7. xsubpp 1.9.
8. Tim's lib.pm module (with patched corrected spelling of 2nd :-).
9. Tim's Exporter module version patches.
10. Tim's MakeMaker patches for make test when LINKTYPE=static.
11. Randal's pod2html patches.
12. Spider's "picky compiler" patches for x2p/util.[ch]
13. Paul's updated source filtering patches.
Patch and enjoy. I hope nothing breaks :-).
Andy Dougherty doughera@lafcol.lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
Diffstat (limited to 'installperl')
-rwxr-xr-x | installperl | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/installperl b/installperl index 0530d154f2..87b81ac2f1 100755 --- a/installperl +++ b/installperl @@ -69,10 +69,10 @@ if ($d_shrplib) { # First we install the version-numbered executables. -&unlink("$installbin/perl$ver"); +&safe_unlink("$installbin/perl$ver"); &cmd("cp perl $installbin/perl$ver"); -&unlink("$installbin/sperl$ver"); +&safe_unlink("$installbin/sperl$ver"); if ($d_dosuid) { &cmd("cp suidperl $installbin/sperl$ver"); &chmod(04711, "$installbin/sperl$ver"); @@ -83,13 +83,13 @@ exit 0 if $versiononly; # Make links to ordinary names if installbin directory isn't current directory. if (! &samepath($installbin, '.')) { - &unlink("$installbin/perl", "$installbin/suidperl"); + &safe_unlink("$installbin/perl", "$installbin/suidperl"); &link("$installbin/perl$ver", "$installbin/perl"); &link("$installbin/sperl$ver", "$installbin/suidperl") if $d_dosuid; } if (! &samepath($installbin, 'x2p')) { - &unlink("$installbin/a2p"); + &safe_unlink("$installbin/a2p"); &cmd("cp x2p/a2p $installbin/a2p"); &chmod(0755, "$installbin/a2p"); } @@ -248,6 +248,22 @@ sub unlink { } } +sub safe_unlink { + local(@names) = @_; + + foreach $name (@names) { + next unless -e $name; + print STDERR " unlink $name\n"; + next if $nonono; + next if unlink($name); + warn "Couldn't unlink $name: $!\n"; + if ($! =~ /busy/i) { + print STDERR " mv $name $name.old\n"; + &rename($name, "$name.old") || warn "Couldn't rename $name: $!\n"; + } + } +} + sub cmd { local($cmd) = @_; print STDERR " $cmd\n"; @@ -257,6 +273,19 @@ sub cmd { } } +sub rename { + local($from,$to) = @_; + unless (unlink($to)) { + my($i); + for ($i = 1; $i < 50; $i++) { + last if rename($to, "$to.$i"); + } + return 0 if $i >= 50; # Give up! + } + link($from,$to) || return 0; + unlink($from); +} + sub link { local($from,$to) = @_; @@ -304,6 +333,10 @@ sub installlib { $dir =~ s#^\.(?![^/])/?##; my $name = $_; + + # ignore patch backups and the .exists files. + return if $name =~ m{\.orig$|~$|^\.exists}; + $name = "$dir/$name" if $dir ne ''; my $installlib = $installprivlib; |