From 3419b77efca19b206f21d6fe23006b4227933641 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 16 Nov 2023 16:32:31 +0300 Subject: Fix pkg-build by denying dropping package if it has dependents --- bpkg/pkg-build-collect.hxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bpkg/pkg-build-collect.hxx') diff --git a/bpkg/pkg-build-collect.hxx b/bpkg/pkg-build-collect.hxx index ece3d90..122ed22 100644 --- a/bpkg/pkg-build-collect.hxx +++ b/bpkg/pkg-build-collect.hxx @@ -1237,12 +1237,13 @@ namespace bpkg // // Consult replaced_vers for an existing version replacement entry and // 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. + // Ignore the entry if its version doesn't satisfy the specified + // dependency constraints or the entry is a package drop and the specified + // required-by package names have the "required by dependents" semantics. + // 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 @@ -1544,7 +1545,9 @@ namespace bpkg const function&, const function&); - // Collect the package being dropped. + // Collect the package being dropped. Noop if the specified package is + // already being built and its required-by package names have the + // "required by dependents" semantics. // // Add entry to replaced_vers and throw replace_version if the existing // version needs to be dropped but this can't be done in-place (see -- cgit v1.1