diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-12-29 14:10:28 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-12-29 14:10:28 +0000 |
commit | 1f7aba8112a33e16bd848b36c4f1cb28567a4bb1 (patch) | |
tree | 463324beb7ce70655c3248356b526e77449ff32c /usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | |
parent | d76478b24fcdf5f8d37591b1cd2bd6198c2247e6 (diff) |
show `reading plist' while deleting packages, since we can do this easily,
and this gives a hint about what is going on for big packages (like tetex).
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index b98d4e2021f..68152be9817 100644 --- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm +++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: ProgressMeter.pm,v 1.4 2004/12/29 01:11:13 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.5 2004/12/29 14:10:27 espie Exp $ # # Copyright (c) 2004 Marc Espie <espie@openbsd.org> # @@ -85,10 +85,25 @@ sub set_header return $isatty; } +sub message +{ + return unless $isatty; + my $message = shift; + my $d; + if ($playfield) { + $d = "$header|".substr($message, 0, $playfield); + } else { + $d = $header; + } + return if $d eq $lastdisplay; + $lastdisplay=$d; + print STDERR $d, "\r"; +} + sub show { - my ($current, $total) = @_; return unless $isatty; + my ($current, $total) = @_; my $d; if ($playfield) { |