summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-05-27 22:04:18 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-05-27 22:04:18 +0000
commitb97b0341f458061e500cf047ffec14b97ee535cf (patch)
treeb05577143f53a871543388181ffaaa4012adf55a /usr.sbin/pkg_add/OpenBSD
parent35f9a56694feea7244f3875bcb9666ff9376b6af (diff)
move packing-list validation to the UpdateSet level.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Vstat.pm35
2 files changed, 36 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index a7cd0a9a9e2..e35f2a4e0d2 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.54 2007/05/22 11:02:57 espie Exp $
+# $OpenBSD: Add.pm,v 1.55 2007/05/27 22:04:17 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -76,7 +76,7 @@ sub validate_plist($$)
}
Fatal "fatal issues in installing $pkgname" if $problems;
$totsize = 1 if $totsize == 0;
- return $totsize;
+ $plist->{totsize} = $totsize;
}
sub borked_installation
diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
index a496adde8a6..f3463cbb0d6 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.24 2007/05/27 11:21:55 espie Exp $
+# $OpenBSD: Vstat.pm,v 1.25 2007/05/27 22:04:17 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -284,6 +284,39 @@ sub add_older
push(@{$self->{older}}, @handles);
}
+sub newer
+{
+ my $self =shift;
+ return @{$self->{newer}};
+}
+
+sub older
+{
+ my $self = shift;
+ require OpenBSD::PackageInfo;
+ my @l = ();
+ for my $h (@{$self->{older}}) {
+ if (OpenBSD::PackageInfo::is_installed($h->{pkgname})) {
+ push(@l, $h);
+ }
+ }
+ return @l;
+}
+
+sub validate_plists
+{
+ my ($self, $state) = @_;
+ for my $o ($self->older) {
+ require OpenBSD::Delete;
+ OpenBSD::Delete::validate_plist($o->{plist}, $state);
+ }
+ for my $n ($self->newer) {
+ require OpenBSD::Add;
+ OpenBSD::Add::validate_plist($n->{plist}, $state);
+ }
+ OpenBSD::Vstat::synchronize();
+}
+
# temporary shortcut
sub handle
{