From 61a7600c6e2bd900b36eb94b1f9dae6a9b374db9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Nov 2018 12:36:02 +0200 Subject: Clean up command line variable handling in pkg-configure, pkg- This reflects the change we've made in the build system to the semantics in this area a while ago. --- bpkg/pkg-command.cxx | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'bpkg/pkg-command.cxx') 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 ()) -- cgit v1.1