From c8f2a2c0776aee57af6af10d4a0128befbc1fdeb Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Mar 2018 14:31:03 +0200 Subject: Fix bug in find_project_packages() logic --- bdep/project.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bdep/project.cxx b/bdep/project.cxx index ebc466c..e09371e 100644 --- a/bdep/project.cxx +++ b/bdep/project.cxx @@ -136,7 +136,8 @@ namespace bdep // Ignore errors when checking for file existence since we may be // iterating over directories past any reasonable project boundaries. // - if (exists (d / manifest_file, true)) + bool p (exists (d / manifest_file, true)); + if (p) { if (pkg) { @@ -154,10 +155,15 @@ namespace bdep // Check for the database file first since an (initialized) simple // project mosl likely won't have any *.manifest files. // - if (exists (d / bdep_file, true) || - exists (d / packages_file, true) || - exists (d / repositories_file, true) || - exists (d / configurations_file, true)) + if (exists (d / bdep_file, true) || + exists (d / packages_file, true) || + // + // We should only consider {repositories,configurations}.manifest if + // we have either packages.manifest or manifest (i.e., this is a + // valid project root). + // + (p && (exists (d / repositories_file, true) || + exists (d / configurations_file, true)))) { prj = move (d); break; -- cgit v1.1