diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-07 15:00:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-07 15:00:34 +0200 |
commit | 6a8953c64aaf7cfcd081f0750dcfb9c89aea49e7 (patch) | |
tree | ce3226dfe04704f1616fa88e703b3b94e52a0699 | |
parent | 545e427106ba9ebfa66db1e3bba3cf13078a213c (diff) |
Diagnose non-global variable specified with --build-option (GH issue #276)
-rw-r--r-- | bpkg/bpkg.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index 4af4140..b5eaf7d 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -158,6 +158,17 @@ namespace bpkg if (bo.help () || bo.version ()) fail << "--help or --version specified with --build-option"; + + // Make sure someone didn't specify a non-global override with + // --build-option, which messes our global/package-specific config + // variable split. + // + for (const string& v: bc.cmd_vars) + { + if (v[0] != '!') + fail << "non-global configuration variable '" << v + << "' specified with --build-option"; + } } build2_cmd_vars = move (bc.cmd_vars); |