diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2016-06-15 15:31:10 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2016-06-15 15:31:10 +0000 |
commit | 3f92c505855dc5363b3e60b6dc034b370f40d8e9 (patch) | |
tree | 4c5cd6d074b2916615aed3b4a782e0f6a5e8fb83 | |
parent | 86d33767320cc5a0e8eecaf6306fbec88b4e3f68 (diff) |
ProgressMeter keeps state. Unfortunately, term is shared between processes.
Adds supplementary code that was first tested in proot, but may be needed
to split pkg_add into processes in the future.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index 6265ab94778..17ffdc6cc41 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.47 2015/05/18 10:41:20 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.48 2016/06/15 15:31:09 espie Exp $ # # Copyright (c) 2010 Marc Espie <espie@openbsd.org> # @@ -84,6 +84,8 @@ sub for_list package OpenBSD::ProgressMeter::Stub; our @ISA = qw(OpenBSD::ProgressMeter); +sub forked {} + sub clear {} diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm index cc050b9e1c1..ef72c7f401f 100644 --- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm +++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Term.pm,v 1.35 2016/05/15 10:29:01 espie Exp $ +# $OpenBSD: Term.pm,v 1.36 2016/06/15 15:31:09 espie Exp $ # # Copyright (c) 2004-2007 Marc Espie <espie@openbsd.org> # @@ -86,6 +86,12 @@ use POSIX; use Term::Cap; use Term::ReadKey; +sub forked +{ + my $self = shift; + $self->{lastdisplay} = ' 'x($self->{width}-1); +} + sub init { my $self = shift; |