diff options
author | 2007-06-07 12:57:33 +0000 | |
---|---|---|
committer | 2007-06-07 12:57:33 +0000 | |
commit | c7f2e4981cb980a9dcc91382e50e7ec4a06cba64 (patch) | |
tree | bb4e3eebafebbc82dfa8b90b40f284559f266c4d | |
parent | GET should have been SET (diff) | |
download | wireguard-openbsd-c7f2e4981cb980a9dcc91382e50e7ec4a06cba64.tar.xz wireguard-openbsd-c7f2e4981cb980a9dcc91382e50e7ec4a06cba64.zip |
make compute_size explicit. That way, we can do it once, at the right
moment.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Replace.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Vstat.pm | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 9 |
3 files changed, 13 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm index 13fef63eb67..68fa785b20a 100644 --- a/usr.sbin/pkg_add/OpenBSD/Replace.pm +++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Replace.pm,v 1.35 2007/06/06 15:31:06 espie Exp $ +# $OpenBSD: Replace.pm,v 1.36 2007/06/07 12:57:33 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -427,8 +427,6 @@ sub save_old_libraries print "Libraries to keep: ", join(",", sort(keys %$libs)), "\n" if $state->{beverbose}; ($o->{plist}, my $stub_list) = split_libs($o->{plist}, $libs); - $o->{totsize} = $o->{plist}->compute_size; - my $stub_name = $stub_list->pkgname; my $dest = installed_info($stub_name); print "Keeping them in $stub_name\n" if $state->{beverbose}; diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm index 0ec95fa5cde..e89a781f071 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.37 2007/06/06 15:36:32 espie Exp $ +# $OpenBSD: Vstat.pm,v 1.38 2007/06/07 12:57:33 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -433,6 +433,11 @@ sub validate_plists OpenBSD::Error::Fatal "fatal issues in ", $self->print; } OpenBSD::Vstat::synchronize(); +} + +sub compute_size +{ + my ($self, $state) = @_; for my $h ($self->older_to_do, $self->newer) { $h->{totsize} = $h->{plist}->compute_size; } diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 9b9574d3ed5..1d238aaba55 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.311 2007/06/05 23:19:00 espie Exp $ +# $OpenBSD: pkg_add,v 1.312 2007/06/07 12:57:33 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -367,10 +367,13 @@ sub really_add if ($replacing) { require OpenBSD::Replace; + OpenBSD::Replace::save_old_libraries($set, $state); + } - $state->progress->set_header("$pkgname (extracting)"); + $set->compute_size; - OpenBSD::Replace::save_old_libraries($set, $state); + if ($replacing) { + $state->progress->set_header("$pkgname (extracting)"); try { OpenBSD::Replace::perform_extraction($handle, $state); |