summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-28 19:27:59 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-28 19:27:59 +0000
commitdbc26588e69e626ff88755f5442453a956e79be3 (patch)
treedcdfe768262b7dc54d6db62ebb3232801fb2a2a0 /usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm
parent898fd758e1ce8c82987b200d5efc43fa829c50f7 (diff)
prepare to handle forward dependencies in a simpler way
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm24
1 files changed, 21 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm b/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm
index 56e950a9e28..bdf8aa5eb33 100644
--- a/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: ForwardDependencies.pm,v 1.1 2009/12/26 17:00:49 espie Exp $
+# $OpenBSD: ForwardDependencies.pm,v 1.2 2009/12/28 19:27:58 espie Exp $
#
# Copyright (c) 2009 Marc Espie <espie@openbsd.org>
#
@@ -34,12 +34,30 @@ sub find
$forward->{$f} = 1;
}
}
- bless $forward, $class;
+ bless { forward => $forward, set => $set}, $class;
+}
+
+sub adjust
+{
+ my ($self, $state) = @_;
+ my $set = $self->{set};
+
+ for my $f (keys %{$self->{forward}}) {
+ my $deps_f = OpenBSD::Requiring->new($f);
+ for my $check ($deps_f->list) {
+ if (defined $set->{older}->{$check}) {
+ my $r = $set->{older}->{$check}->{update_found}->pkgname;
+ $state->say("Should adjust $check to $r in $f");
+ }
+ }
+ }
}
sub check
{
- my ($forward, $set, $state) = @_;
+ my ($self, $state) = @_;
+ my $forward = $self->{forward};
+ my $set = $self->{set};
my @r = keys %$forward;