From 3fcf4d75b8ce134c2d771cf428a249977cfdf962 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 18 Aug 2016 15:12:17 +0200 Subject: Lighten up config.install.* output in config.build Now we omit non-global NULL values for cmd, options, mode, dir_mode, and sudo. --- build2/install/init.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'build2/install/init.cxx') diff --git a/build2/install/init.cxx b/build2/install/init.cxx index 6e1a2a2a..06a33662 100644 --- a/build2/install/init.cxx +++ b/build2/install/init.cxx @@ -33,7 +33,8 @@ namespace build2 // configurations. We have to do this for paths that contain the // package name. // - // For global values we only set config.install.* variables. + // For global values we only set config.install.* variables. Non-global + // values with NULL defaults are omitted. // template static void @@ -62,7 +63,9 @@ namespace build2 cv = dv != nullptr ? &config::required (r, vr, *dv, override).first.get () - : &config::optional (r, vr); + : (global + ? &config::optional (r, vr) + : config::omitted (r, vr).first); } if (global) @@ -77,7 +80,7 @@ namespace build2 if (spec) { - if (*cv && !cv->empty ()) // @@ BC LT [null] + if (cv != nullptr && *cv && !cv->empty ()) // @@ BC LT [null] v = cast (*cv); // Strip CT to T. } else -- cgit