aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_build.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-04-12 22:57:23 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-04-12 22:57:23 -0700
commitc3b54a2e7bd0a07068b6a12c29b00b8f57bdb3f1 (patch)
tree65f0fbf52220f8f5225da13a69afa415c0c0ff09 /toolsrc/src/commands_build.cpp
parent7069fbbebc750a7c8a64adc8c30269527cbec9bd (diff)
parent3739e8e0b998b14c0f320c21618057e50698c51d (diff)
downloadvcpkg-c3b54a2e7bd0a07068b6a12c29b00b8f57bdb3f1.tar.gz
vcpkg-c3b54a2e7bd0a07068b6a12c29b00b8f57bdb3f1.zip
Merge from master
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);
}