From c087efe145a75087acd646abe3258dad4aef4e2a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 29 Apr 2015 10:49:03 +0200 Subject: Update global scope config.import.* value to avoid warning --- build/file.cxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/build/file.cxx b/build/file.cxx index f3f62ac..d3fc8eb 100644 --- a/build/file.cxx +++ b/build/file.cxx @@ -306,26 +306,30 @@ namespace build // for usability's sake, treat a simple name that doesn't end // with '/' as a directory. // - const list_value& lv (v.as ()); + list_value& lv (v.as ()); - if (lv.size () == 1) - { - const name& n (lv.front ()); + if (lv.size () != 1 || lv[0].empty () || !lv[0].type.empty ()) + fail (l) << "invalid " << var << " value " << lv; - if (n.directory ()) - out_root = n.dir; - else if (n.simple ()) - out_root = dir_path (n.value); - } + name& n (lv[0]); - if (out_root.empty ()) - fail (l) << "invalid " << var << " value " << lv; + if (n.directory ()) + out_root = n.dir; + else + out_root = dir_path (n.value); if (out_root.relative ()) out_root = work / out_root; out_root.normalize (); iroot.assign (var) = out_root; + + // Also update the command-line value. This is necessary to avoid + // a warning issued by the config module about global/root scope + // value mismatch. + // + if (n.dir != out_root) + n = name (out_root); } } else -- cgit v1.1