aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-10-10 18:27:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-10-13 07:41:19 +0200
commite72d7d7c121b4a16de011646c2ce6a6baad3b2b8 (patch)
tree69251a7f12f2724fdc773357832a611f6f8289a6
parent33b205cde8bff7828228610b57adbe99fa7fe408 (diff)
Adjust package skeleton to public/private variable model
-rw-r--r--bpkg/package-skeleton.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx
index 48de2d0..f7047c7 100644
--- a/bpkg/package-skeleton.cxx
+++ b/bpkg/package-skeleton.cxx
@@ -515,6 +515,8 @@ namespace bpkg
// variable), then the saved variables map seem like the natural place
// to keep this information.
//
+ // Note: go straight for the public variable pool.
+ //
for (const variable& var: rs.ctx.var_pool)
{
if (!project_variable (var.name, var_prefix_))
@@ -616,8 +618,10 @@ namespace bpkg
create_context (*this, strings {});
context& ctx (*ctx_);
+ // Note: go straight for the public variable pool.
+ //
scope& gs (ctx.global_scope.rw ());
- auto& vp (ctx.var_pool.rw ());
+ auto& vp (gs.var_pool (true /* public */));
for (const string& v: config_vars_)
{
@@ -1065,10 +1069,11 @@ namespace bpkg
// Add to the vars set the reflect variables collected previously.
//
- auto& vp (rs.var_pool ());
for (const reflect_variable_value& v: reflect_)
{
- const variable* var (vp.find (v.name));
+ // Note: go straight for the public variable pool.
+ //
+ const variable* var (rs.ctx.var_pool.find (v.name));
assert (var != nullptr); // Must be there (set by load()).
auto p (vars.insert (rvar {var, nullptr, 0}));
@@ -2142,7 +2147,9 @@ namespace bpkg
//
load_root (rs);
- if (const variable* var = rs.var_pool ().find (var_prefix_ + ".develop"))
+ // Note: go straight for the public variable pool.
+ //
+ if (const variable* var = rs.ctx.var_pool.find (var_prefix_ + ".develop"))
{
// Use the fact that the variable is typed as a proxy for it being
// defined with config directive (the more accurate way would be via
@@ -2329,7 +2336,9 @@ namespace bpkg
assert (vt != nullptr);
}
- return rs.var_pool ().insert (name, vt);
+ // Note: go straight for the public variable pool.
+ //
+ return rs.var_pool (true /* public */).insert (name, vt);
};
for (const reflect_variable_value& v: reflect_)