diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-04-14 16:01:19 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-04-14 16:01:19 -0700 |
| commit | 1c08a42091cb0addd1e0c1daf27d24bf4e9d237f (patch) | |
| tree | f8c69e701dfae791fe180a8c24b35a4195668afd /toolsrc/src | |
| parent | 23366aede0cb1ccfeac85a28308bc722811b18bc (diff) | |
| parent | b3541eff15847b2cc90736a609b8c6f99ce74a9d (diff) | |
| download | vcpkg-1c08a42091cb0addd1e0c1daf27d24bf4e9d237f.tar.gz vcpkg-1c08a42091cb0addd1e0c1daf27d24bf4e9d237f.zip | |
Merge from master
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/commands_build.cpp | 4 | ||||
| -rw-r--r-- | toolsrc/src/commands_hash.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_integrate.cpp | 5 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Dependencies.cpp | 8 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Strings.cpp | 5 | ||||
| -rw-r--r-- | toolsrc/src/vcpkglib.cpp | 5 |
6 files changed, 10 insertions, 19 deletions
diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 9110e1fd0..ab792f1bc 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -150,9 +150,9 @@ namespace vcpkg::Commands::Build if (result == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) { std::vector<InstallPlanAction> unmet_dependencies = Dependencies::create_install_plan(paths, { spec }, status_db); - Util::keep_if(unmet_dependencies, [&spec](const InstallPlanAction& p) + Util::erase_remove_if(unmet_dependencies, [&spec](const InstallPlanAction& p) { - return (p.spec != spec) && (p.plan_type != InstallPlanType::ALREADY_INSTALLED); + return (p.spec == spec) || (p.plan_type == InstallPlanType::ALREADY_INSTALLED); }); Checks::check_exit(VCPKG_LINE_INFO, !unmet_dependencies.empty()); diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/commands_hash.cpp index a9024d9e7..b6355dfbd 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/commands_hash.cpp @@ -21,7 +21,7 @@ namespace vcpkg::Commands::Hash Checks::check_exit(VCPKG_LINE_INFO, end != std::string::npos, "Unexpected output format from command: %s", Strings::utf16_to_utf8(cmd_line)); auto hash = output.substr(start, end - start); - Util::keep_if(hash, [](char c) {return !isspace(c); }); + Util::erase_remove_if(hash, isspace); System::println(hash); } diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/commands_integrate.cpp index 819c29082..5772843df 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/commands_integrate.cpp @@ -67,10 +67,7 @@ namespace vcpkg::Commands::Integrate dir_id.erase(1, 1); // Erasing the ":" // NuGet id cannot have invalid characters. We will only use alphanumeric and dot. - Util::keep_if(dir_id, [](char c) - { - return isalnum(c) || (c == '.'); - }); + Util::erase_remove_if(dir_id, [](char c) { return !isalnum(c) && (c != '.'); }); const std::string nuget_id = "vcpkg." + dir_id; return nuget_id; diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp index 03e3c2aeb..151ee28f4 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg_Dependencies.cpp @@ -143,10 +143,10 @@ namespace vcpkg::Dependencies const std::unordered_set<PackageSpec> specs_as_set(specs.cbegin(), specs.cend()); std::vector<InstallPlanAction> toposort = Graphs::topological_sort(specs, InstallAdjacencyProvider{ paths, status_db, specs_as_set }); - Util::keep_if(toposort, [](const InstallPlanAction& p) - { - return !(p.request_type == RequestType::AUTO_SELECTED && p.plan_type == InstallPlanType::ALREADY_INSTALLED); - }); + Util::erase_remove_if(toposort, [](const InstallPlanAction& p) + { + return p.request_type == RequestType::AUTO_SELECTED && p.plan_type == InstallPlanType::ALREADY_INSTALLED; + }); return toposort; } diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg_Strings.cpp index 3d9895436..5f46af6d2 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg_Strings.cpp @@ -99,10 +99,7 @@ namespace vcpkg::Strings trim(&s); } - Util::keep_if(*strings, [](const std::string& s)-> bool - { - return s != ""; - }); + Util::erase_remove_if(*strings, [](const std::string& s) { return s == ""; }); } std::vector<std::string> split(const std::string& s, const std::string& delimiter) diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp index 7f2d737cb..90d3e99b9 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkglib.cpp @@ -201,10 +201,7 @@ namespace vcpkg upgrade_to_slash_terminated_sorted_format(fs, &installed_files_of_current_pgh, listfile_path); // Remove the directories - Util::keep_if(installed_files_of_current_pgh, [](const std::string& file) -> bool - { - return file.back() != '/'; - }); + Util::erase_remove_if(installed_files_of_current_pgh, [](const std::string& file) { return file.back() == '/'; }); StatusParagraphAndAssociatedFiles pgh_and_files = { *pgh, SortedVector<std::string>(std::move(installed_files_of_current_pgh)) }; installed_files.push_back(std::move(pgh_and_files)); |
