diff options
author | Abigail <abigail@abigail.be> | 2000-08-24 15:27:03 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-25 17:14:23 +0000 |
commit | eabd589f70149821b1750f3075b52180c8426efc (patch) | |
tree | 7075e6b4caf2641a98a158d6bfb17f06c230e64f /installman | |
parent | 94b11c62fe74111382b3d071bdec99836ea5052c (diff) | |
download | perl-eabd589f70149821b1750f3075b52180c8426efc.tar.gz |
Re: [PATCH] More silencing of installman.
Date: Thu, 24 Aug 2000 19:27:03 -0400
Message-ID: <20000824232703.7001.qmail@foad.org>
Subject: Re: [PATCH] More silencing of installman.
From: <abigail@foad.org>
Date: Fri, 25 Aug 2000 03:00:58 -0400
Message-ID: <20000825070058.10697.qmail@foad.org>
p4raw-id: //depot/perl@6813
Diffstat (limited to 'installman')
-rwxr-xr-x | installman | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/installman b/installman index 7c4314ba58..5615802eb0 100755 --- a/installman +++ b/installman @@ -22,16 +22,18 @@ die "Patchlevel of perl ($patchlevel)", $usage = "Usage: installman --man1dir=/usr/wherever --man1ext=1 --man3dir=/usr/wherever --man3ext=3 - --notify --silent --help + --notify --verbose --silent --help Defaults are: man1dir = $Config{'installman1dir'}; man1ext = $Config{'man1ext'}; man3dir = $Config{'installman3dir'}; man3ext = $Config{'man3ext'}; - --notify (or -n) just lists commands that would be executed. - --silent (or -S) be silent. Only report errors.\n"; + --notify (or -n) just lists commands that would be executed. + --verbose (or -V) report all progress. + --silent (or -S) be silent. Only report errors.\n"; -GetOptions( qw( man1dir=s man1ext=s man3dir=s man3ext=s notify n help silent S)) +GetOptions( qw( man1dir=s man1ext=s man3dir=s man3ext=s notify n help silent S + verbose V)) || die $usage; die $usage if $opt_help; @@ -41,6 +43,7 @@ $man1ext = defined($opt_man1ext) ? $opt_man1ext : $Config{'man1ext'}; $man3dir = defined($opt_man3dir) ? $opt_man3dir : $Config{'installman3dir'}; $man3ext = defined($opt_man3ext) ? $opt_man3ext : $Config{'man3ext'}; $silent = $opt_silent || $opt_S; +$verbose = $opt_verbose || $opt_V; $notify = $opt_notify || $opt_n; @@ -106,7 +109,7 @@ sub runpod2man { return; } - warn "chdir $poddir\n" unless $silent; + print " chdir $poddir\n" if $verbose; chdir $poddir || die "Unable to cd to $poddir directory!\n$!\n"; # We insist on using the current version of pod2man in case there @@ -162,7 +165,7 @@ sub runpod2man { } } chdir "$builddir" || die "Unable to cd back to $builddir directory!\n$!\n"; - warn "chdir $builddir\n" unless $silent; + print " chdir $builddir\n" if $verbose; } sub lsmodpods { @@ -175,7 +178,7 @@ sub lsmodpods { } $packlist->write() unless $notify; -warn " Installation complete\n" unless $silent; +print " Installation complete\n" if $verbose; exit 0; @@ -185,7 +188,7 @@ exit 0; sub cmd { local($cmd) = @_; - warn " $cmd\n" unless $silent; + print " $cmd\n" if $verbose; unless ($notify) { if ($Config{d_fork}) { fork ? wait : exec $cmd; # Allow user to ^C out of command. @@ -205,7 +208,7 @@ sub unlink { foreach $name (@names) { next unless -e $name; chmod 0777, $name if $^O eq 'os2'; - warn " unlink $name\n" unless $silent; + print " unlink $name\n" if $verbose; ( CORE::unlink($name) and ++$cnt or warn "Couldn't unlink $name: $!\n" ) unless $notify; } @@ -216,7 +219,7 @@ sub link { my($from,$to) = @_; my($success) = 0; - warn " ln $from $to\n" unless $silent; + print $verbose ? " ln $from $to\n" : " $to\n" unless $silent; eval { CORE::link($from, $to) ? $success++ @@ -251,7 +254,7 @@ sub rename { sub chmod { local($mode,$name) = @_; - warn( " chmod %o %s\n", $mode, $name) unless $silent; + printf " chmod %o %s\n", $mode, $name if $verbose; CORE::chmod($mode,$name) || warn sprintf("Couldn't chmod %o %s: $!\n",$mode,$name) unless $notify; } |