From 4db621c4cb73a0f53e38ec33665254990c5285f3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Aug 2021 07:14:39 +0200 Subject: Make sure configuration is not inside project with glue buildfile --- bdep/config.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bdep/config.cxx b/bdep/config.cxx index f06bb98..f16d8b0 100644 --- a/bdep/config.cxx +++ b/bdep/config.cxx @@ -120,7 +120,8 @@ namespace bdep name = move (s); } - // Verify the configuration directory is not inside one of the packages. + // Verify the configuration directory is not inside one of the packages or + // the project itself if it has a glue buildfile. // static void verify_configuration_path (const dir_path& cfg, @@ -135,6 +136,18 @@ namespace bdep fail << "configuration directory " << cfg << " is inside package " << p.name << " (" << d << ")"; } + + if (cfg.sub (prj)) + { + path bf; + if (exists (bf = prj / "buildfile") || exists (bf = prj / "build2file")) + { + fail << "configuration directory " << cfg << " is inside project " + << "directory " << prj << + info << "remove glue " << bf << " if you would like to keep " + << "configurations inside your project"; + } + } } shared_ptr -- cgit v1.1