aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-16 16:37:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-16 16:37:47 +0200
commit6931b4f6c007e68584c15483529e2293ca68a007 (patch)
treed670ba88138c75a68ab93722628c5b43e403f4e5
parente771c6b80168de37b74cc57dec502dfa418a19a6 (diff)
Diagnose specifying initialized package as dependency
-rw-r--r--bdep/sync.cxx21
1 files changed, 20 insertions, 1 deletions
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
{