From bee8c4afc182e20de9b7e7bd907bee72cfa55889 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 15 Nov 2023 22:11:03 +0300 Subject: Fix pkg-build by ignoring version replacement if it doesn't satisfy dependency constraints --- bpkg/pkg-build-collect.hxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'bpkg/pkg-build-collect.hxx') diff --git a/bpkg/pkg-build-collect.hxx b/bpkg/pkg-build-collect.hxx index 86878f0..ece3d90 100644 --- a/bpkg/pkg-build-collect.hxx +++ b/bpkg/pkg-build-collect.hxx @@ -1236,8 +1236,15 @@ namespace bpkg // replaced with the drop. So can be used as bool. // // Consult replaced_vers for an existing version replacement entry and - // follow it, if present, potentially collecting the package drop - // instead. Add entry to replaced_vers and throw replace_version if the + // follow it, if present, potentially collecting the package drop instead. + // Ignore the entry if its version doesn't satisfy the dependency + // constraints specified by the caller. In this case it's likely that this + // replacement will be applied for some later collect_build() call but can + // potentially turn out bogus. Note that a version replacement for a + // specific package may only be applied once during the collection + // iteration. + // + // Add entry to replaced_vers and throw replace_version if the // existing version needs to be replaced but the new version cannot be // re-collected recursively in-place (see replaced_versions for details). // -- cgit v1.1