diff options
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Dependencies.pm | 17 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 11 |
2 files changed, 18 insertions, 10 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm index 957f99ba7e1..46b7c2ceac3 100644 --- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm +++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Dependencies.pm,v 1.37 2007/05/18 12:18:33 espie Exp $ +# $OpenBSD: Dependencies.pm,v 1.38 2007/05/19 23:40:46 espie Exp $ # # Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org> # @@ -173,6 +173,21 @@ sub dump } } +sub register_dependencies +{ + my $self = shift; + + require OpenBSD::RequiredBy; + my $pkgname = $self->pkgname; + + my $r = OpenBSD::Requiring->new($pkgname); + + for my $dep ($self->dependencies) { + OpenBSD::RequiredBy->new($dep)->add($pkgname); + $r->add($dep); + } +} + use OpenBSD::SharedLibs; sub check_lib_spec diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index f9f4f574e35..c5376a65467 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.253 2007/05/18 09:45:18 espie Exp $ +# $OpenBSD: pkg_add,v 1.254 2007/05/19 23:40:46 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -427,14 +427,7 @@ sub really_add($$) my $dest = installed_info($pkgname); OpenBSD::Add::register_installation($dir, $dest, $plist); if (defined $handle->{solver}) { - require OpenBSD::RequiredBy; - - my $r = OpenBSD::Requiring->new($pkgname); - - for my $dep ($handle->{solver}->dependencies) { - OpenBSD::RequiredBy->new($dep)->add($pkgname); - $r->add($dep); - } + $handle->{solver}->register_dependencies; } add_installed($pkgname); OpenBSD::PkgCfl::register($plist, $state); |