summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-07-07 16:45:04 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-07-07 16:45:04 +0000
commite70c19af54675f1cab0ca87af667795f60952665 (patch)
tree02c36b146ef474823184d2419fcd6686ae3baf20 /usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
parentdb95fe94f2bcf829938c31216eb5e39b89762180 (diff)
record how many bytes we saved for statistics purposes.
exit the loop thru the same end code every time for consistency.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
index c153d4fa15e..5803677c6f2 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.42 2014/07/01 09:21:14 espie Exp $
+# $OpenBSD: ProgressMeter.pm,v 1.43 2014/07/07 16:45:03 espie Exp $
#
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
#
@@ -143,4 +143,11 @@ sub advance
}
}
+sub saved
+{
+ my $self = shift;
+ $self->{state}{stats}{totsize} += $self->{totsize};
+ $self->{state}{stats}{donesize} += $self->{donesize};
+}
+
1;