summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Update.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-09 10:17:53 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-09 10:17:53 +0000
commit0d54b6753087a536e4886327faab98283098e9a4 (patch)
treedbb06796c11226c1f69e67bed3869002ed5f6ebc /usr.sbin/pkg_add/OpenBSD/Update.pm
parent5fc97f2b9cf140a3cddfc7dba07a6a2abce857fe (diff)
save dir in plist, not state (unconfuse script operations when several
plists are present). Encapsulate `extract' operation in `extract_with_pm' to allow progress meter to do something sensible when replacing packages.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Update.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Update.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm
index 6a07b725e42..a61cf1db79d 100644
--- a/usr.sbin/pkg_add/OpenBSD/Update.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Update.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Update.pm,v 1.15 2004/11/09 09:58:56 espie Exp $
+# $OpenBSD: Update.pm,v 1.16 2004/11/09 10:17:52 espie Exp $
#
# Copyright (c) 2004 Marc Espie <espie@openbsd.org>
#
@@ -48,6 +48,19 @@ sub unmark_lib
{
}
+sub extract_with_pm
+{
+ require OpenBSD::ProgressMeter;
+
+ my ($self, $state) = @_;
+
+ $self->extract($state);
+ if (defined $self->{size}) {
+ $state->{donesize} += $self->{size};
+ OpenBSD::ProgressMeter::show($state->{donesize}, $state->{totsize});
+ }
+}
+
package OpenBSD::PackingElement::FileBase;
use File::Temp qw/tempfile/;