diff options
author | Hallvard B Furuseth <h.b.furuseth@usit.uio.no> | 1996-02-08 01:36:50 +0100 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-02-08 01:36:50 +0100 |
commit | 6d64b06f7a33b9ca2cabcae3d8408ab3bbdfbf62 (patch) | |
tree | 73a791832fd4ccd2406da02ffbaf04219e15d020 /installman | |
parent | 0093f865a9591685e5133706620ffc98921355da (diff) | |
download | perl-6d64b06f7a33b9ca2cabcae3d8408ab3bbdfbf62.tar.gz |
installman patch: Dont remove manpages unless the new one is good
Fix 2 installman bugs:
* If the old manpage existed, it was removed even if $pod2man failed.
* If installman aborted, an incomplete manpage was left in $MANPATH.
Diffstat (limited to 'installman')
-rwxr-xr-x | installman | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/installman b/installman index 13cb75f649..76ab23c558 100755 --- a/installman +++ b/installman @@ -90,13 +90,15 @@ sub runpod2man { $manpage =~ s#\.p(m|od)$##; $manpage =~ s#/#::#g; $manpage = "${mandir}/${manpage}.${manext}"; - &cmd("$pod2man $mod > $manpage"); - if (-z $manpage) { - print STDERR "unlink $manpage\n"; - unless ($notify) { - unlink($manpage) || warn "cannot unlink $manpage: $!"; - } - } + &cmd("$pod2man $mod > $manpage.tmp"); + if (-s "$manpage.tmp") { + rename("$manpage.tmp", $manpage) && next; + warn "cannot rename to $manpage: $!"; + } + print STDERR "unlink $manpage.tmp\n"; + unless ($notify) { + unlink("$manpage.tmp") || warn "cannot unlink $manpage.tmp: $!"; + } } chdir "$builddir" || die "Unable to cd back to $builddir directory!\n$!\n"; } |