$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;
$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;
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
}
}
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 {
}
$packlist->write() unless $notify;
-warn " Installation complete\n" unless $silent;
+print " Installation complete\n" if $verbose;
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.
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;
}
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++
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;
}