summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Delete.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-03-22 20:38:45 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-03-22 20:38:45 +0000
commit415635d5a32f125670ce1bc754f396cc727cd426 (patch)
tree9dbdb630fe4d0bb7ea35198ebcb923dd38fb1e10 /usr.sbin/pkg_add/OpenBSD/Delete.pm
parent69aac48fb85ddcc0842cf23f31b29ca9697c34ae (diff)
clean up the ProgressMeter code, create a specific class if a Term
is around. start using stuff from termcap, specifically, cleareol, and move to hp. use the full line when we can, cram 100% if we can. (this should flicker much less on slow terminals). clean-up the install-and-progress bits to be in progressmeter, this removes some code. have pkg_create follow the same pattern as the others, with a state. This allows us to unify error messages a bit.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Delete.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm15
1 files changed, 2 insertions, 13 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 86320fccb58..20229c33cb7 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.96 2010/01/02 12:59:45 espie Exp $
+# $OpenBSD: Delete.pm,v 1.97 2010/03/22 20:38:44 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -109,7 +109,6 @@ sub delete_package
$state->{problems} = 0;
validate_plist($plist, $state);
- $plist->compute_size;
Fatal "fatal issues in deinstalling $pkgname"
if $state->{problems};
$state->vstat->synchronize;
@@ -143,16 +142,13 @@ sub delete_plist
{
my ($plist, $state) = @_;
- my $totsize = $plist->{totsize};
- my $donesize = 0;
my $pkgname = $plist->pkgname;
$state->{pkgname} = $pkgname;
$ENV{'PKG_PREFIX'} = $plist->localbase;
if (!$state->{size_only}) {
$plist->register_manpage($state);
manpages_unindex($state);
- $state->progress->show(0, $totsize);
- $plist->delete_and_progress($state, \$donesize, $totsize);
+ $state->progress->visit_with_size($plist, 'delete', $state);
if ($plist->has(UNDISPLAY)) {
$plist->get(UNDISPLAY)->prepare($state);
}
@@ -202,13 +198,6 @@ sub delete
{
}
-sub delete_and_progress
-{
- my ($self, $state, $donesize, $totsize) = @_;
- $self->delete($state);
- $self->mark_progress($state->progress, $donesize, $totsize);
-}
-
sub record_shared
{
}