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/dist/init.cxx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'libbuild2/dist') diff --git a/libbuild2/dist/init.cxx b/libbuild2/dist/init.cxx index ff2d757..8eaafa2 100644 --- a/libbuild2/dist/init.cxx +++ b/libbuild2/dist/init.cxx @@ -111,7 +111,10 @@ namespace build2 // must be explicitly specified or we will complain if and when // we try to dist. // - bool s (config::specified (rs, "dist")); + using config::lookup_config; + using config::specified_config; + + bool s (specified_config (rs, "dist")); // Adjust module priority so that the config.dist.* values are saved at // the end of config.build. @@ -126,7 +129,7 @@ namespace build2 if (s) { - if (lookup l = config::optional (rs, "config.dist.root")) + if (lookup l = lookup_config (rs, "config.dist.root", nullptr)) v = cast (l); // Strip abs_dir_path. } } @@ -138,9 +141,9 @@ namespace build2 if (s) { - if (lookup l = config::required (rs, - "config.dist.cmd", - path ("install")).first) + if (lookup l = lookup_config (rs, + "config.dist.cmd", + path ("install"))) v = run_search (cast (l), true); } } @@ -154,10 +157,10 @@ namespace build2 if (s) { - if (lookup l = config::optional (rs, "config.dist.archives")) + if (lookup l = lookup_config (rs, "config.dist.archives", nullptr)) a = *l; - if (lookup l = config::optional (rs, "config.dist.checksums")) + if (lookup l = lookup_config (rs, "config.dist.checksums", nullptr)) { c = *l; @@ -173,7 +176,7 @@ namespace build2 // // Omit it from the configuration unless specified. // - config::omitted (rs, "config.dist.uncommitted"); + lookup_config (rs, "config.dist.uncommitted"); return true; } -- cgit v1.1