aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-command.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-05-14 14:10:56 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-05-14 16:54:16 +0300
commit2df57d72b65012674e6bc64dec66d9b3fd7f993b (patch)
tree81c893c0b745145d9a3779b9ce3fb41c57e17956 /bpkg/pkg-command.cxx
parent1ddbf3409f76f0dd91a9402e602bc1ea1b12f8cd (diff)
Fallback to output directory removal for --keep-out on disfigure failure
Diffstat (limited to 'bpkg/pkg-command.cxx')
-rw-r--r--bpkg/pkg-command.cxx25
1 files changed, 22 insertions, 3 deletions
diff --git a/bpkg/pkg-command.cxx b/bpkg/pkg-command.cxx
index b28c99a..bf7107e 100644
--- a/bpkg/pkg-command.cxx
+++ b/bpkg/pkg-command.cxx
@@ -28,20 +28,39 @@ namespace bpkg
l4 ([&]{trace << "command: " << cmd;});
+ // Set common vars on the configuration scope.
+ //
+ 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 canonical 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).
//
string bspec;
- auto run =
- [&trace, &c, &o, &cvars, &bspec] ( const strings& vars = strings ())
+ auto run = [&trace, &c, &o, &lvars, &gvars, &bspec] (
+ const strings& vars = strings ())
{
if (!bspec.empty ())
{
bspec += ')';
l4 ([&]{trace << "buildspec: " << bspec;});
- run_b (o, c, bspec, verb_b::normal, vars, cvars);
+ run_b (o, verb_b::normal, gvars, lvars, vars, bspec);
bspec.clear ();
}
};