summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-02-03 19:56:54 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-02-03 19:56:54 +0000
commitd8eb09b1e818a7dd4a6f4d45b89083abd046064f (patch)
tree14d05045b478889d339dfed8bd8c5eee4aa0b0c3
parentd5718393295115a87df071eb1345c051d29683f3 (diff)
perl is actually VERY BAD at scraping captured variables until the end.
Avoid creating a gratuitous back reference to that packing-list. Prevents us from keeping shas around... :(
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm
index a5faac06917..9b7f40ac4bd 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.20 2014/01/30 13:23:51 espie Exp $
+# $OpenBSD: Term.pm,v 1.21 2014/02/03 19:56:53 espie Exp $
#
# Copyright (c) 2004-2007 Marc Espie <espie@openbsd.org>
#
@@ -82,11 +82,12 @@ sub visit_with_size
my ($progress, $plist, $method, $state, @r) = @_;
$plist->{totsize} //= compute_size($plist);
my $donesize = 0;
- $progress->show($donesize, $plist->{totsize});
+ my $totsize = $plist->{totsize};
+ $progress->show($donesize, $totsize);
if (defined $state->{archive}) {
$state->{archive}{callback} = sub {
my $done = shift;
- $progress->show($donesize + $done, $plist->{totsize});
+ $progress->show($donesize + $done, $totsize);
};
}
$plist->size_and($progress, \$donesize, $plist->{totsize},