From ba162023e2fe747a80c0e56367e358545c7e4559 Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 12 Oct 2021 09:06:37 +0000 Subject: [PATCH] do the matching as a last resort to handle .libs fix the bug I introduced that bluhm@ et al noticed --- .../pkg_add/OpenBSD/ForwardDependencies.pm | 23 ++++++++++++++++++- usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 20 +--------------- 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 # @@ -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) = @_; @@ -47,6 +65,9 @@ sub adjust my $h = $set->{older}{$check}; 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); 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 # @@ -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); } } -- 2.20.1