diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2006-01-24 20:14:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2006-01-24 20:14:14 +0000 |
commit | 733fe93634dd9f38207604cad55d15c4b71fa575 (patch) | |
tree | 346d74c385cd490ea0399497dfbc36393866d64b /usr.sbin/pkg_add | |
parent | a67c4fa21a64f93b1e954711ef44150d326e29b2 (diff) |
protect against weird situations where dependencies don't match
(admittedly, we should recompute them, but that's already better than
nothing).
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Update.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index de0933542df..7c90ae6190f 100644 --- a/usr.sbin/pkg_add/OpenBSD/Update.pm +++ b/usr.sbin/pkg_add/OpenBSD/Update.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Update.pm,v 1.59 2005/11/05 10:59:21 espie Exp $ +# $OpenBSD: Update.pm,v 1.60 2006/01/24 20:14:13 espie Exp $ # # Copyright (c) 2004 Marc Espie <espie@openbsd.org> # @@ -283,8 +283,12 @@ sub can_do for my $wanting (@wantlist) { my $p2 = OpenBSD::PackingList->from_installation( $wanting, \&OpenBSD::PackingList::DependOnly); - $p2->visit('validate_depend', $state, $wanting, - $toreplace, $replacement); + if (!defined $p2) { + Warn "Error: $wanting missing from installation\n" + } else { + $p2->visit('validate_depend', $state, $wanting, + $toreplace, $replacement); + } } } |