From 6931b4f6c007e68584c15483529e2293ca68a007 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 May 2018 16:37:47 +0200 Subject: Diagnose specifying initialized package as dependency --- bdep/sync.cxx | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/bdep/sync.cxx b/bdep/sync.cxx index 651f6ad..5ea1726 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -194,6 +194,25 @@ namespace bdep // load_implicit (co, cfg, origin_prj, prjs); + // Verify that no initialized package in any of the projects sharing this + // configuration is specified as a dependency. + // + for (const string& n: dep_pkgs) + { + for (const project& prj: prjs) + { + auto& pkgs (prj.config->packages); + + if (find_if (pkgs.begin (), + pkgs.end (), + [&n] (const package_state& ps) + { + return n == ps.name; + }) != pkgs.end ()) + fail << "initialized package " << n << " specified as a dependency"; + } + } + // Prepare the list of packages to build and repositories to fetch. // strings args; @@ -747,7 +766,7 @@ namespace bdep o.upgrade (), o.recursive (), prj_pkgs, - dep_pkgs); + strings () /* dep_pkgs */); } else { -- cgit v1.1