aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_build.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/commands_build.cpp')
-rw-r--r--toolsrc/src/commands_build.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp
index 8d91ce813..9110e1fd0 100644
--- a/toolsrc/src/commands_build.cpp
+++ b/toolsrc/src/commands_build.cpp
@@ -10,10 +10,11 @@
#include "metrics.h"
#include "vcpkg_Enums.h"
#include "Paragraphs.h"
+#include "vcpkg_Util.h"
namespace vcpkg::Commands::Build
{
- using Dependencies::PackageSpecWithInstallPlan;
+ using Dependencies::InstallPlanAction;
using Dependencies::InstallPlanType;
static const std::string OPTION_CHECKS_ONLY = "--checks-only";
@@ -148,19 +149,17 @@ namespace vcpkg::Commands::Build
const BuildResult result = build_package(spgh, spec, paths, paths.port_dir(spec), status_db);
if (result == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES)
{
- std::vector<PackageSpecWithInstallPlan> unmet_dependencies = Dependencies::create_install_plan(paths, { spec }, status_db);
- unmet_dependencies.erase(
- std::remove_if(unmet_dependencies.begin(), unmet_dependencies.end(), [&spec](const PackageSpecWithInstallPlan& p)
- {
- return (p.spec == spec) || (p.plan.plan_type == InstallPlanType::ALREADY_INSTALLED);
- }),
- unmet_dependencies.end());
+ std::vector<InstallPlanAction> unmet_dependencies = Dependencies::create_install_plan(paths, { spec }, status_db);
+ Util::keep_if(unmet_dependencies, [&spec](const InstallPlanAction& p)
+ {
+ return (p.spec != spec) && (p.plan_type != InstallPlanType::ALREADY_INSTALLED);
+ });
Checks::check_exit(VCPKG_LINE_INFO, !unmet_dependencies.empty());
System::println(System::Color::error, "The build command requires all dependencies to be already installed.");
System::println("The following dependencies are missing:");
System::println("");
- for (const PackageSpecWithInstallPlan& p : unmet_dependencies)
+ for (const InstallPlanAction& p : unmet_dependencies)
{
System::println(" %s", p.spec);
}