summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Vstat.pm
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/Vstat.pm
parent35f9a56694feea7244f3875bcb9666ff9376b6af (diff)
move packing-list validation to the UpdateSet level.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Vstat.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Vstat.pm35
1 files changed, 34 insertions, 1 deletions
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
{