From 9f71deeeb0f8e6fe2c29f209fc96f466fc2831b6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Mar 2020 08:06:15 +0200 Subject: Rework config::{omitted,required,optional}() into unified config_lookup() --- libbuild2/install/init.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'libbuild2/install') diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx index 34a5625..06e5d3a 100644 --- a/libbuild2/install/init.cxx +++ b/libbuild2/install/init.cxx @@ -63,11 +63,13 @@ namespace build2 vn += var; const variable& vr (rs.var_pool ().insert (move (vn), true)); + using config::lookup_config; + l = dv != nullptr - ? config::required (rs, vr, *dv, override).first + ? lookup_config (rs, vr, *dv, 0 /* save_flags */, override) : (global - ? config::optional (rs, vr) - : config::omitted (rs, vr).first); + ? lookup_config (rs, vr, nullptr) + : lookup_config (rs, vr)); } if (global) @@ -237,8 +239,10 @@ namespace build2 // { using build2::path; + using config::lookup_config; + using config::specified_config; - bool s (config::specified (rs, "install")); + bool s (specified_config (rs, "install")); // Adjust module priority so that the (numerous) config.install.* // values are saved at the end of config.build. @@ -280,7 +284,7 @@ namespace build2 if (s) { - if (lookup l = config::optional (rs, cvar)) + if (lookup l = lookup_config (rs, cvar, nullptr)) v = cast (l); // Strip abs_dir_path. } } -- cgit v1.1