diff options
-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_); } } |