summaryrefslogtreecommitdiff
path: root/installman
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-24 10:50:14 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-24 10:50:14 +0000
commit72b3d9b4e0eb3eb49735d998edaf49073f03375e (patch)
tree8c4df5e657006c76c68a24a4b1564c68f9bd6579 /installman
parent04c29d09afec9ef8d03486a2dbccb8c99ffe92e9 (diff)
downloadperl-72b3d9b4e0eb3eb49735d998edaf49073f03375e.tar.gz
install all README.foo with pod content as podfoo.pod
p4raw-id: //depot/perl@4431
Diffstat (limited to 'installman')
-rwxr-xr-xinstallman38
1 files changed, 20 insertions, 18 deletions
diff --git a/installman b/installman
index 55dee4f325..a70fdd3ba9 100755
--- a/installman
+++ b/installman
@@ -127,7 +127,8 @@ sub runpod2man {
# of the pod. This might be useful for pod2man someday.
if ($script) {
@modpods = ($script);
- } else {
+ }
+ else {
@modpods = ();
find(\&lsmodpods, '.');
}
@@ -143,16 +144,20 @@ sub runpod2man {
$manpage =~ s#\.p(m|od)$##;
if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O =~ /cygwin/) {
$manpage =~ s#/#.#g;
- } else {
+ }
+ else {
$manpage =~ s#/#::#g;
}
$tmp = "${mandir}/${manpage}.tmp";
$manpage = "${mandir}/${manpage}.${manext}";
if (&cmd("$pod2man $mod > $tmp") == 0 && !$notify && -s $tmp) {
- rename($tmp, $manpage) && next;
+ if (rename($tmp, $manpage)) {
+ $packlist->{$manpage} = { type => 'file' };
+ next;
+ }
}
unless ($notify) {
- unlink($tmp);
+ unlink($tmp);
}
}
chdir "$builddir" || die "Unable to cd back to $builddir directory!\n$!\n";
@@ -197,11 +202,11 @@ sub unlink {
my $cnt = 0;
foreach $name (@names) {
-next unless -e $name;
-chmod 0777, $name if $^O eq 'os2';
-print STDERR " unlink $name\n";
-( CORE::unlink($name) and ++$cnt
- or warn "Couldn't unlink $name: $!\n" ) unless $notify;
+ next unless -e $name;
+ chmod 0777, $name if $^O eq 'os2';
+ print STDERR " unlink $name\n";
+ ( CORE::unlink($name) and ++$cnt
+ or warn "Couldn't unlink $name: $!\n" ) unless $notify;
}
return $cnt;
}
@@ -218,14 +223,12 @@ sub link {
? die "AFS" # okay inside eval {}
: warn "Couldn't link $from to $to: $!\n"
unless $notify;
- $packlist->{$to} = { type => 'file' };
};
if ($@) {
File::Copy::copy($from, $to)
? $success++
: warn "Couldn't copy $from to $to: $!\n"
unless $notify;
- $packlist->{$to} = { type => 'file' };
}
$success;
}
@@ -233,16 +236,15 @@ sub link {
sub rename {
local($from,$to) = @_;
if (-f $to and not unlink($to)) {
-my($i);
-for ($i = 1; $i < 50; $i++) {
- last if CORE::rename($to, "$to.$i");
-}
-warn("Cannot rename to `$to.$i': $!"), return 0
- if $i >= 50; # Give up!
+ my($i);
+ for ($i = 1; $i < 50; $i++) {
+ last if CORE::rename($to, "$to.$i");
+ }
+ warn("Cannot rename to `$to.$i': $!"), return 0
+ if $i >= 50; # Give up!
}
link($from,$to) || return 0;
unlink($from);
- $packlist->{$to} = { type => 'file' };
}
sub chmod {