diff options
-rw-r--r-- | bdep/config.cxx | 24 | ||||
-rw-r--r-- | bdep/config.hxx | 10 | ||||
-rw-r--r-- | bdep/sync.cxx | 31 |
3 files changed, 55 insertions, 10 deletions
diff --git a/bdep/config.cxx b/bdep/config.cxx index 31f4c14..6929fb7 100644 --- a/bdep/config.cxx +++ b/bdep/config.cxx @@ -212,13 +212,20 @@ namespace bdep cmd_config_add_print (diag_record& dr, const dir_path& prj, const dir_path& path, - const optional<string>& name) + const optional<string>& name, + bool def, + bool fwd, + bool asy) { dr << "bdep config add -d " << quote (prj); if (name) dr << " @" << *name; + dr << (def ? " --default" : " --no-default"); + dr << (fwd ? " --forward" : " --no-forward"); + dr << (asy ? "" : " --no-auto-sync"); + dr << ' ' << quote (path); } @@ -478,14 +485,23 @@ namespace bdep const dir_path& prj, const dir_path& path, const optional<string>& name, - const string& type) + const string& type, + bool def, + bool fwd, + bool asy) { - dr << "bdep config create -d " << quote (prj) - << " --config-type " << type; + dr << "bdep config create -d " << quote (prj); if (name) dr << " @" << *name; + if (type != "target") + dr << " --config-type " << type; + + dr << (def ? " --default" : " --no-default"); + dr << (fwd ? " --forward" : " --no-forward"); + dr << (asy ? "" : " --no-auto-sync"); + dr << ' ' << quote (path); } diff --git a/bdep/config.hxx b/bdep/config.hxx index 9134bee..b2f820c 100644 --- a/bdep/config.hxx +++ b/bdep/config.hxx @@ -47,7 +47,10 @@ namespace bdep cmd_config_add_print (diag_record&, const dir_path& prj, const dir_path&, - const optional<string>& name); + const optional<string>& name, + bool default_ = true, + bool forward = true, + bool auto_sync = true); shared_ptr<configuration> cmd_config_create (const common_options&, @@ -83,7 +86,10 @@ namespace bdep const dir_path& prj, const dir_path&, const optional<string>& name, - const string& type); + const string& type, + bool default_ = true, + bool forward = true, + bool auto_sync = true); void cmd_config_link (const common_options&, diff --git a/bdep/sync.cxx b/bdep/sync.cxx index f855c60..825ac3d 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -582,12 +582,21 @@ namespace bdep dr << "as if by executing commands:" << '\n'; dr << " "; - cmd_config_create_print (dr, src_prj, dep_dir, dep_type, dep_type); + cmd_config_create_print (dr, + src_prj, + dep_dir, + dep_type, + dep_type, + false, true, true); // See below. for (size_t i (1); i != dpt_prjs.size (); ++i) { dr << "\n "; - cmd_config_add_print (dr, dpt_prjs[i], dep_dir, dep_type); + cmd_config_add_print (dr, + dpt_prjs[i], + dep_dir, + dep_type, + false, true, true); // See below. } } @@ -625,12 +634,23 @@ namespace bdep // auto_rmdir rmd (dep_dir); + // Before we used to create the default configuration but that lead + // to counter-intuitive behavior (like trying to run tests in a host + // configuration that doesn't have any bdep-init'ed packages). After + // meditation it became clear that we want the default configuration + // if we are developing the package and non-default if we just use + // it. And automatic creation is probably a good proxy for the "just + // use" case. + // dep_cfg = cmd_config_create (co, prj, transaction::current (), dep_dir, dep_type /* name */, - dep_type); + dep_type, + false /* default */, + true /* forward */, + true /* auto_sync */); cmd_config_link (co, dpt_cfg, dep_cfg); @@ -647,7 +667,10 @@ namespace bdep transaction::current (), dep_dir, dep_type /* name */, - dep_type /* type */); + dep_type, + false /* default */, + true /* forward */, + true /* auto_sync */); } t.commit (); |