summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
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
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')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm5
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm9
2 files changed, 11 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 6d911859ec9..c001ee30d8d 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.157 2014/07/01 09:22:40 espie Exp $
+# $OpenBSD: Add.pm,v 1.158 2014/07/07 16:45:03 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -128,7 +128,7 @@ sub perform_extraction
if (keys %$tied > 0) {
$handle->{location}{early_close} = 1;
}
- return;
+ last;
}
my $e = $tied->{$file->name};
if (defined $e) {
@@ -153,6 +153,7 @@ sub perform_extraction
if (keys %$wanted > 0) {
$state->fatal("Truncated archive");
}
+ $p->saved;
}
my $user_tagged = {};
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;