aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/install
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-01-28 08:41:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-01-28 08:41:57 +0200
commitccb417a7c1456427b76914e8a11ca87b4926eeb3 (patch)
treed68803a1a1a013b1bb50f845459d0145c221eb79 /libbuild2/install
parentc0105aad0074aee0efb3ba41f8132496412f8790 (diff)
Use scope::var_pool()
Diffstat (limited to 'libbuild2/install')
-rw-r--r--libbuild2/install/init.cxx33
-rw-r--r--libbuild2/install/utility.hxx4
2 files changed, 18 insertions, 19 deletions
diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx
index 98eec91..fdcc627 100644
--- a/libbuild2/install/init.cxx
+++ b/libbuild2/install/init.cxx
@@ -40,7 +40,7 @@ namespace build2
template <typename T, typename CT>
static void
set_var (bool spec,
- scope& r,
+ scope& rs,
const char* name,
const char* var,
const CT* dv,
@@ -62,13 +62,13 @@ namespace build2
vn += name;
}
vn += var;
- const variable& vr (r.ctx.var_pool.rw (r).insert<CT> (move (vn), true));
+ const variable& vr (rs.var_pool ().insert<CT> (move (vn), true));
l = dv != nullptr
- ? config::required (r, vr, *dv, override).first
+ ? config::required (rs, vr, *dv, override).first
: (global
- ? config::optional (r, vr)
- : config::omitted (r, vr).first);
+ ? config::optional (rs, vr)
+ : config::omitted (rs, vr).first);
}
if (global)
@@ -79,9 +79,9 @@ namespace build2
vn = "install.";
vn += name;
vn += var;
- const variable& vr (r.ctx.var_pool.rw (r).insert<T> (move (vn)));
+ const variable& vr (rs.var_pool ().insert<T> (move (vn)));
- value& v (r.assign (vr));
+ value& v (rs.assign (vr));
if (spec)
{
@@ -98,7 +98,7 @@ namespace build2
template <typename T>
static void
set_dir (bool s, // specified
- scope& r, // root scope
+ scope& rs, // root scope
const char* n, // var name
const T& p, // path
bool o = false, // override
@@ -111,19 +111,18 @@ namespace build2
bool global (*n == '\0');
if (!global)
- set_var<dir_path> (s, r, n, "", p.empty () ? nullptr : &p, o);
+ set_var<dir_path> (s, rs, n, "", p.empty () ? nullptr : &p, o);
- set_var<path> (s, r, n, ".cmd", c.empty () ? nullptr : &c);
- set_var<strings> (s, r, n, ".options", (strings*) (nullptr));
- set_var<string> (s, r, n, ".mode", fm.empty () ? nullptr : &fm);
- set_var<string> (s, r, n, ".dir_mode", dm.empty () ? nullptr : &dm);
- set_var<string> (s, r, n, ".sudo", (string*) (nullptr));
+ set_var<path> (s, rs, n, ".cmd", c.empty () ? nullptr : &c);
+ set_var<strings> (s, rs, n, ".options", (strings*) (nullptr));
+ set_var<string> (s, rs, n, ".mode", fm.empty () ? nullptr : &fm);
+ set_var<string> (s, rs, n, ".dir_mode", dm.empty () ? nullptr : &dm);
+ set_var<string> (s, rs, n, ".sudo", (string*) (nullptr));
// This one doesn't have config.* value (only set in a buildfile).
//
if (!global)
- r.ctx.var_pool.rw (r).insert<bool> (
- string ("install.") + n + ".subdirs");
+ rs.var_pool ().insert<bool> (string ("install.") + n + ".subdirs");
}
void
@@ -194,7 +193,7 @@ namespace build2
// Enter module variables.
//
- auto& vp (rs.ctx.var_pool.rw (rs));
+ auto& vp (rs.var_pool ());
// Note that the set_dir() calls below enter some more.
//
diff --git a/libbuild2/install/utility.hxx b/libbuild2/install/utility.hxx
index 24c82d8..fae7c43 100644
--- a/libbuild2/install/utility.hxx
+++ b/libbuild2/install/utility.hxx
@@ -24,7 +24,7 @@ namespace build2
{
auto r (
s.target_vars[tt]["*"].insert (
- s.ctx.var_pool.rw (s).insert ("install")));
+ s.var_pool ().insert ("install")));
if (r.second) // Already set by the user?
r.first.get () = path_cast<path> (move (d));
@@ -42,7 +42,7 @@ namespace build2
{
auto r (
s.target_vars[tt]["*"].insert (
- s.ctx.var_pool.rw (s).insert ("install.mode")));
+ s.var_pool ().insert ("install.mode")));
if (r.second) // Already set by the user?
r.first.get () = move (m);