aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-command.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-09 12:36:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-09 12:36:02 +0200
commit61a7600c6e2bd900b36eb94b1f9dae6a9b374db9 (patch)
tree6e6c4653600bf5be2d5fbf68a489b21a11eed5cb /bpkg/pkg-command.cxx
parent25fdb8f5d54a5a789d5b9eac0247cf95b7296e89 (diff)
Clean up command line variable handling in pkg-configure, pkg-<command>
This reflects the change we've made in the build system to the semantics in this area a while ago.
Diffstat (limited to 'bpkg/pkg-command.cxx')
-rw-r--r--bpkg/pkg-command.cxx33
1 files changed, 9 insertions, 24 deletions
diff --git a/bpkg/pkg-command.cxx b/bpkg/pkg-command.cxx
index 863e351..6b82c29 100644
--- a/bpkg/pkg-command.cxx
+++ b/bpkg/pkg-command.cxx
@@ -29,39 +29,22 @@ namespace bpkg
l4 ([&]{trace << "command: " << cmd;});
- // Set common vars on the configuration scope.
+ // This one is a bit tricky: we can only update all the packages at once
+ // if they don't have any package-specific variables. But let's try to
+ // handle this with the same logic (being clever again).
//
- cstrings gvars;
- strings lvars;
- lvars.reserve (cvars.size ());
-
- for (const string& v: cvars)
- {
- // Don't scope-qualify global variables.
- //
- if (v[0] == '!')
- gvars.push_back (v.c_str ());
-
- // Use path representation to get the trailing slash.
- //
- else
- lvars.push_back (c.representation () + v);
- }
-
- // This one is a bit tricky: we can only update all the packages at once if
- // they don't have any package-specific variables. But let's try to handle
- // this with the same logic (being clever again).
+ // @@ If the build system supported command line variable grouping, then
+ // we could always build at once.
//
string bspec;
- auto run = [&trace, &o, &lvars, &gvars, &bspec] (
- const strings& vars = strings ())
+ auto run = [&trace, &o, &cvars, &bspec] (const strings& vars = strings ())
{
if (!bspec.empty ())
{
bspec += ')';
l4 ([&]{trace << "buildspec: " << bspec;});
- run_b (o, verb_b::normal, gvars, lvars, vars, bspec);
+ run_b (o, verb_b::normal, cvars, vars, bspec);
bspec.clear ();
}
};
@@ -155,6 +138,8 @@ namespace bpkg
// First read the common variables.
//
+ // @@ TODO: redo using argument groups.
+ //
auto read_vars = [&args](strings& v)
{
for (; args.more (); args.next ())