diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-12-28 19:27:59 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-12-28 19:27:59 +0000 |
commit | dbc26588e69e626ff88755f5442453a956e79be3 (patch) | |
tree | dcdfe768262b7dc54d6db62ebb3232801fb2a2a0 /usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm | |
parent | 898fd758e1ce8c82987b200d5efc43fa829c50f7 (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.pm | 24 |
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; |