summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-06 15:35:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-06 15:35:21 +0000
commitea9a8816b779692801a49aeccf42395dc82dd521 (patch)
tree59364923b03b7cbe0190be5db7478fb3e6f74a1a /usr.sbin/pkg_add
parent90cb3427e2ac45ac819802bb9297290a0e9ec312 (diff)
finish moving the size computations out of validate_plist.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm3
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Vstat.pm11
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 5a35bcb0220..6e77e89e917 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.74 2007/06/06 15:31:06 espie Exp $
+# $OpenBSD: Add.pm,v 1.75 2007/06/06 15:35:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -60,7 +60,6 @@ sub validate_plist
my ($plist, $state) = @_;
$plist->prepare_for_addition($state, $plist->pkgname);
- return $plist->compute_size;
}
sub record_partial_installation
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index b55f5ab1800..653199bb734 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.64 2007/06/06 15:31:06 espie Exp $
+# $OpenBSD: Delete.pm,v 1.65 2007/06/06 15:35:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -85,7 +85,6 @@ sub validate_plist
my ($plist, $state) = @_;
$plist->prepare_for_deletion($state, $plist->pkgname);
- return $plist->compute_size;
}
sub remove_packing_info
@@ -117,6 +116,7 @@ sub delete_package
$state->{problems} = 0;
validate_plist($plist, $state);
+ $plist->compute_size;
Fatal "fatal issues in deinstalling $pkgname"
if $state->{problems};
OpenBSD::Vstat::synchronize();
diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
index 2830db844bc..3892f9317cc 100644
--- a/usr.sbin/pkg_add/OpenBSD/Vstat.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Vstat.pm,v 1.35 2007/06/06 15:31:06 espie Exp $
+# $OpenBSD: Vstat.pm,v 1.36 2007/06/06 15:35:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -413,14 +413,12 @@ sub validate_plists
for my $o ($self->older_to_do) {
require OpenBSD::Delete;
- $o->{totsize} =
- OpenBSD::Delete::validate_plist($o->{plist}, $state);
+ OpenBSD::Delete::validate_plist($o->{plist}, $state);
}
$state->{colliding} = [];
for my $n ($self->newer) {
require OpenBSD::Add;
- $n->{totsize} =
- OpenBSD::Add::validate_plist($n->{plist}, $state);
+ OpenBSD::Add::validate_plist($n->{plist}, $state);
}
if (@{$state->{colliding}} > 0) {
require OpenBSD::CollisionReport;
@@ -435,6 +433,9 @@ sub validate_plists
OpenBSD::Error::Fatal "fatal issues in ", $self->print;
}
OpenBSD::Vstat::synchronize();
+ for my $h ($self->older, $self->newer) {
+ $h->{totsize} = $h->{plist}->compute_size;
+ }
}
# temporary shortcut