diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-06-14 12:54:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-06-14 14:46:53 +0200 |
commit | cdbf968d003392a08c6dda204023e51a8b4e1e8e (patch) | |
tree | d52aa7f9f5f9a756d21f56d507d53b749e0c2c1d | |
parent | 4391385adce139b0722471b411fd45b6e52a787d (diff) |
Fix few logic bugs in configuration negotiation
-rw-r--r-- | bpkg/package-configuration.cxx | 8 | ||||
-rw-r--r-- | bpkg/package-skeleton.cxx | 13 |
2 files changed, 14 insertions, 7 deletions
diff --git a/bpkg/package-configuration.cxx b/bpkg/package-configuration.cxx index 6d0c5c3..8298893 100644 --- a/bpkg/package-configuration.cxx +++ b/bpkg/package-configuration.cxx @@ -298,8 +298,12 @@ namespace bpkg } else { - assert (ov->dependent != *v.dependent); - cycle = true; + // Note that it's possible the same dependent overrides its + // old value (e.g., because a conditional default changed to a + // better value). + // + if (ov->dependent != *v.dependent) + cycle = true; } } diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx index 72192ff..c98d48d 100644 --- a/bpkg/package-skeleton.cxx +++ b/bpkg/package-skeleton.cxx @@ -512,11 +512,14 @@ namespace bpkg { if (config_variable_value* ov = old.find (v.name)) { - assert (ov->origin == variable_origin::buildfile); - - v.origin = variable_origin::buildfile; - v.dependent = move (ov->dependent); - v.confirmed = ov->confirmed; + if (ov->origin == variable_origin::buildfile) + { + v.origin = variable_origin::buildfile; + v.dependent = move (ov->dependent); + v.confirmed = ov->confirmed; + } + else + assert (ov->origin == variable_origin::override_); } } |