aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-18 15:12:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-18 15:12:17 +0200
commit3fcf4d75b8ce134c2d771cf428a249977cfdf962 (patch)
treefc9bcac7eeb3277069743a7bfe9a331e6a226dac
parentca55c178784779e13245ae2e8760d5ff7c7a4a9f (diff)
Lighten up config.install.* output in config.build
Now we omit non-global NULL values for cmd, options, mode, dir_mode, and sudo.
-rw-r--r--build2/install/init.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/build2/install/init.cxx b/build2/install/init.cxx
index 6e1a2a2..06a3366 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 <typename T, typename CT>
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<T> (*cv); // Strip CT to T.
}
else