summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2021-10-12 09:06:38 +0000
committerMarc Espie <espie@cvs.openbsd.org>2021-10-12 09:06:38 +0000
commit6425c53ed1ee106c4e6efe0e0156bf72c41f3536 (patch)
tree22d7dcaa2f7ed67e14ddeb76ed40fcf4b21a427a /usr.sbin/pkg_add
parent10b9db03e31666807fa3c9b4685a27a082b671c8 (diff)
do the matching as a last resort to handle .libs
fix the bug I introduced that bluhm@ et al noticed
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm23
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm20
2 files changed, 23 insertions, 20 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm b/usr.sbin/pkg_add/OpenBSD/ForwardDependencies.pm
index ca8f7010239..db99078e6e0 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.16 2020/02/19 10:53:53 espie Exp $
+# $OpenBSD: ForwardDependencies.pm,v 1.17 2021/10/12 09:06:37 espie Exp $
#
# Copyright (c) 2009 Marc Espie <espie@openbsd.org>
#
@@ -36,6 +36,24 @@ sub find
bless { forward => $forward, set => $set}, $class;
}
+sub find_belated_update
+{
+ my ($set, $state, $old) = @_;
+
+ for my $n ($set->newer) {
+ if ($n->conflict_list->conflicts_with($old->pkgname)) {
+ if (defined $old->{update_found}) {
+ $state->errsay("Ambiguous update #1 vs #2",
+ $n->pkgname,
+ $old->{update_found}->pkgname);
+ } else {
+ $old->{update_found} = $n;
+ }
+ }
+ }
+ return $old->{update_found};
+}
+
sub adjust
{
my ($self, $state) = @_;
@@ -48,6 +66,9 @@ sub adjust
next unless defined $h;
my $r = $h->{update_found};
if (!defined $r) {
+ $r =find_belated_update($set, $state, $h);
+ }
+ if (!defined $r) {
$state->errsay("XXX #1", $check);
$deps_f->delete($check);
next;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index a676e171f8c..32299074829 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.121 2021/10/06 14:23:50 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.122 2021/10/12 09:06:37 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -463,23 +463,6 @@ LOOP: for my $c (@conflicts) {
return 1;
}
-sub find_belated_update
-{
- my ($set, $state, $old) = @_;
-
- for my $n ($set->newer) {
- if ($n->conflict_list->conflicts_with($old->pkgname)) {
- if (defined $old->{update_found}) {
- $state->errsay("Ambiguous update #1 vs #2",
- $n->pkgname,
- $old->{update_found}->pkgname);
- } else {
- $old->{update_found} = $n;
- }
- }
- }
-}
-
sub install_issues
{
my ($set, $state) = @_;
@@ -522,7 +505,6 @@ sub install_issues
} else {
my $h = OpenBSD::Handle->create_old($toreplace, $state);
$set->add_older($h);
- find_belated_update($set, $state, $h);
}
}