aboutsummaryrefslogtreecommitdiff
path: root/libbpkg/manifest.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2020-04-09 19:41:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2020-04-10 14:16:19 +0300
commitbf42edca4c714138b59f429f44368a71a855902f (patch)
tree9b692243c8910ad52d5d04e1772c2311808dd96d /libbpkg/manifest.cxx
parent10b1d816fbea0f7c88fa1e4c56b5d757212fe751 (diff)
Override build constraints group values hierarchically
Diffstat (limited to 'libbpkg/manifest.cxx')
-rw-r--r--libbpkg/manifest.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/libbpkg/manifest.cxx b/libbpkg/manifest.cxx
index 7de5f7e..c1c541f 100644
--- a/libbpkg/manifest.cxx
+++ b/libbpkg/manifest.cxx
@@ -2413,15 +2413,27 @@ namespace bpkg
void package_manifest::
override (const vector<manifest_name_value>& nvs, const string& name)
{
+ // Reset the build constraints value sub-group on the first call.
+ //
+ bool rbc (true);
+ auto reset_build_constraints = [&rbc, this] ()
+ {
+ if (rbc)
+ {
+ build_constraints.clear ();
+ rbc = false;
+ }
+ };
+
// Reset the builds value group on the first call.
//
bool rb (true);
- auto reset_builds = [&rb, this] ()
+ auto reset_builds = [&rb, &reset_build_constraints, this] ()
{
if (rb)
{
builds.clear ();
- build_constraints.clear ();
+ reset_build_constraints ();
rb = false;
}
};
@@ -2451,14 +2463,14 @@ namespace bpkg
}
else if (n == "build-include")
{
- reset_builds ();
+ reset_build_constraints ();
build_constraints.push_back (
parse_build_constraint (nv, false /* exclusion */, name));
}
else if (n == "build-exclude")
{
- reset_builds ();
+ reset_build_constraints ();
build_constraints.push_back (
parse_build_constraint (nv, true /* exclusion */, name));