From b76346651a0e27e8824af4bb59224792df8dd4d0 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 30 Mar 2022 17:13:57 +0300 Subject: Fix bdep-status output in JSON format not to fail for non-initialized packages --- bdep/project.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bdep/project.cxx') diff --git a/bdep/project.cxx b/bdep/project.cxx index 5650dea..975454f 100644 --- a/bdep/project.cxx +++ b/bdep/project.cxx @@ -21,7 +21,8 @@ namespace bdep const dir_path& prj, transaction& t, bool fallback_default, - bool validate) + bool validate, + bool allow_none) { configurations r; bool fallback (false); @@ -126,7 +127,12 @@ namespace bdep add (move (c)); if (r.empty ()) + { + if (allow_none) + return make_pair (move (r), false /* fallback */); + fail << "no existing configurations"; + } } // default @@ -340,7 +346,8 @@ namespace bdep project_packages find_project_packages (const dir_paths& dirs, bool ignore_packages, - bool load_packages) + bool load_packages, + bool allow_empty) { project_packages r; @@ -408,7 +415,7 @@ namespace bdep // packages are in it or, if nothing was discovered, use it as the // source for the package list. // - package_locations pls (load_package_locations (r.project)); + package_locations pls (load_package_locations (r.project, allow_empty)); if (!r.packages.empty ()) { -- cgit v1.1