summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2007-05-29 23:12:26 +0000
committerespie <espie@openbsd.org>2007-05-29 23:12:26 +0000
commit103a6ecb2912ef5e44182d7200cf4e48b3a4206a (patch)
treeed7cda7d60e90044c831e122c43619f14f7f1e00
parentImprove copyinstr and copyoutstr by erroring out when the userland (diff)
downloadwireguard-openbsd-103a6ecb2912ef5e44182d7200cf4e48b3a4206a.tar.xz
wireguard-openbsd-103a6ecb2912ef5e44182d7200cf4e48b3a4206a.zip
In update mode, restore previous behavior: some updated packages may have
names that match installed packages, but still mark them to be installed, so that they're returned as dependencies, and get updated first. Write in TODO that the current situation is brittle, solved dependencies should get adjusted in real time to be 100% sure this won't cause problems...
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm7
-rw-r--r--usr.sbin/pkg_add/TODO2
2 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index caf426398fb..23868951f9c 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.40 2007/05/27 11:36:21 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.41 2007/05/29 23:12:26 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -121,6 +121,11 @@ sub solve_dependency
if ($state->{allow_replacing}) {
$v = $self->find_dep_in_stuff_to_install($state, $dep);
+ if ($v) {
+ push(@{$self->{deplist}}, $v);
+ $self->{to_register}->{$v} = $dep;
+ return;
+ }
}
if (!$v) {
diff --git a/usr.sbin/pkg_add/TODO b/usr.sbin/pkg_add/TODO
index 13f3e3023c6..8897e6c6e37 100644
--- a/usr.sbin/pkg_add/TODO
+++ b/usr.sbin/pkg_add/TODO
@@ -1,3 +1,5 @@
+- make sure solved dependencies are adjusted along with stuff that actually
+get installed or replaced... this would make some stuff ways less brittle.
- handle n-to-1 updates: mostly need to allow for a list of replaced packages.
The tricky part is that the replaced packages will often have
inter-dependencies, and we must ignore those inter-dependencies.