diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-05-30 14:04:52 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-05-30 14:04:52 +0000 |
commit | e56a906b41f6a38ce9beeb3f0208dc449668f3ba (patch) | |
tree | 3380608fede29f19c94479b8dfbd94ad45d9dfdc /usr.sbin/pkg_add/OpenBSD/Delete.pm | |
parent | ba627c41a7bc412d55590a52ed12eab5be412606 (diff) |
simplify really_add to use real visitors for extraction and installation.
Just do one single try {} catchall {} per-method, as this is enough.
New methods: extract_and_progress, install_and_progress, that catch
interrupts (die) deal with fake, and handle the progress meter.
One single method: mark_progress, can be used for extraction, installation
and deletion.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Delete.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index fa919e3cb7a..378b525dc87 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Delete.pm,v 1.52 2007/05/30 12:30:15 espie Exp $ +# $OpenBSD: Delete.pm,v 1.53 2007/05/30 14:04:51 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -145,10 +145,7 @@ sub delete_plist my $donesize = 0; for my $item (@{$plist->{groups}}, @{$plist->{users}}, @{$plist->{items}}) { $item->delete($state); - if (defined $item->{size}) { - $donesize += $item->{size}; - OpenBSD::ProgressMeter::show($donesize, $totsize); - } + $item->mark_progress(\$donesize, $totsize); } OpenBSD::ProgressMeter::next(); |