aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-07-20 19:45:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-07-21 11:40:18 +0300
commit8d6f54f819d857aa89135a2474d5951ef02fd068 (patch)
treec25b64320e9fbf2d831d8723f5a02cce91c26133
parent7fa45e22d7f2f47607bbad203a4c48d3b3021724 (diff)
Fix init and sync commands to consider project packages specified on command line
-rw-r--r--bdep/init.cxx1
-rw-r--r--bdep/sync.cxx17
-rw-r--r--bdep/sync.hxx5
3 files changed, 16 insertions, 7 deletions
diff --git a/bdep/init.cxx b/bdep/init.cxx
index f575b52..16fc717 100644
--- a/bdep/init.cxx
+++ b/bdep/init.cxx
@@ -269,6 +269,7 @@ namespace bdep
true /* fetch */,
true /* yes */,
false /* name_cfg */,
+ pkgs,
so,
create_host_config,
create_build2_config,
diff --git a/bdep/sync.cxx b/bdep/sync.cxx
index 45ee46c..46eaf1a 100644
--- a/bdep/sync.cxx
+++ b/bdep/sync.cxx
@@ -1006,9 +1006,10 @@ namespace bdep
//
// If we have dep_pkgs (third form), then non-global configuration
// variables should only apply to them. Otherwise, if we have origin
- // (first form), then they should only apply to packages from the origin
- // project in origin configurations. They don't seem to make sense
- // otherwise (second form, implicit).
+ // (first form), then they should only apply to the specified packages or,
+ // if unspecified, to all packages from the origin project in origin
+ // configurations. They don't seem to make sense otherwise (second form,
+ // implicit).
//
bool dep_vars (false);
bool origin_vars (false);
@@ -1182,7 +1183,7 @@ namespace bdep
}
}
- bool vars (origin_vars && cfg.origin);
+ bool vars (origin_vars && cfg.origin && origin_pkg ());
bool g (multi_cfg || vars || dev || disf);
if (g)
@@ -2134,6 +2135,7 @@ namespace bdep
bool fetch,
bool yes,
bool name_cfg,
+ const package_locations& prj_pkgs,
const sys_options& so,
bool create_host_config,
bool create_build2_config,
@@ -2169,7 +2171,7 @@ namespace bdep
nullopt /* upgrade */,
nullopt /* recursive */,
false /* disfigure */,
- package_locations () /* prj_pkgs */,
+ prj_pkgs,
strings () /* dep_pkgs */,
strings () /* deinit_pkgs */,
so,
@@ -2190,6 +2192,7 @@ namespace bdep
bool fetch,
bool yes,
bool name_cfg,
+ const package_locations& prj_pkgs,
const sys_options& so,
bool create_host_config,
bool create_build2_config)
@@ -2247,7 +2250,7 @@ namespace bdep
nullopt /* upgrade */,
nullopt /* recursive */,
false /* disfigure */,
- package_locations () /* prj_pkgs */,
+ prj_pkgs,
strings () /* dep_pkgs */,
strings () /* deinit_pkgs */,
so,
@@ -2792,7 +2795,7 @@ namespace bdep
nullopt /* upgrade */,
nullopt /* recursive */,
o.disfigure (),
- package_locations () /* prj_pkgs */,
+ prj_pkgs,
strings () /* dep_pkgs */,
strings () /* deinit_pkgs */,
sys_options (o),
diff --git a/bdep/sync.hxx b/bdep/sync.hxx
index 9003836..03ba105 100644
--- a/bdep/sync.hxx
+++ b/bdep/sync.hxx
@@ -39,6 +39,9 @@ namespace bdep
// The optional pkg_args are the additional dependency packages and/or
// configuration variables to pass to bpkg-pkg-build (see bdep-init).
//
+ // If the origin project packages (prj_pkgs) are specified, then non-global
+ // configuration variables are only applied to these packages.
+ //
// If fetch is false, don't perform a (shallow) fetch of the project
// repository. If yes is false, then don't suppress bpkg prompts. If
// name_cfg is true then include the configuration name/directory into
@@ -92,6 +95,7 @@ namespace bdep
bool fetch = true,
bool yes = true,
bool name_cfg = false,
+ const package_locations& prj_pkgs = {},
const sys_options& = sys_options (),
bool create_host_config = false,
bool create_build2_config = false,
@@ -110,6 +114,7 @@ namespace bdep
bool fetch = true,
bool yes = true,
bool name_cfg = false,
+ const package_locations& prj_pkgs = {},
const sys_options& = sys_options (),
bool create_host_config = false,
bool create_build2_config = false);