diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-02-26 14:35:08 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-02-26 14:35:08 -0800 |
| commit | 65e95f6348e3a23a2afd1c1d25c9501dc826b183 (patch) | |
| tree | 75504c7224ac9efbf2a55a0fe1cbfa1022f0c457 /toolsrc/src | |
| parent | b0bea71d57b150f9da27fdec91773c540abc3c5c (diff) | |
| download | vcpkg-65e95f6348e3a23a2afd1c1d25c9501dc826b183.tar.gz vcpkg-65e95f6348e3a23a2afd1c1d25c9501dc826b183.zip | |
[vcpkg] Fix inter-feature references
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/tests.plan.cpp | 15 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/dependencies.cpp | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/toolsrc/src/tests.plan.cpp b/toolsrc/src/tests.plan.cpp index 2bdb4a465..aae4d2ee4 100644 --- a/toolsrc/src/tests.plan.cpp +++ b/toolsrc/src/tests.plan.cpp @@ -821,6 +821,21 @@ namespace UnitTest1 Assert::AreEqual("cpr", remove_plan[0].spec.name().c_str()); Assert::AreEqual("curl", remove_plan[1].spec.name().c_str()); } + + TEST_METHOD(features_depend_core_remove_scheme_2) + { + std::vector<std::unique_ptr<StatusParagraph>> pghs; + pghs.push_back(make_status_pgh("curl", "", "", "x64")); + pghs.push_back(make_status_feature_pgh("curl", "a", "", "x64")); + pghs.push_back(make_status_feature_pgh("curl", "b", "curl[a]", "x64")); + StatusParagraphs status_db(std::move(pghs)); + + auto remove_plan = Dependencies::create_remove_plan( + {unsafe_pspec("curl", Triplet::from_canonical_name("x64"))}, status_db); + + Assert::AreEqual(size_t(1), remove_plan.size()); + Assert::AreEqual("curl", remove_plan[0].spec.name().c_str()); + } }; class UpgradePlanTests : public TestClass<UpgradePlanTests> diff --git a/toolsrc/src/vcpkg/dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp index 43e4d2721..f4a371a2e 100644 --- a/toolsrc/src/vcpkg/dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -317,6 +317,8 @@ namespace vcpkg::Dependencies { dep.erase(std::find(dep.begin(), dep.end(), '['), dep.end()); } + Util::unstable_keep_if(deps, + [&](auto&& e) { return e != an_installed_package->package.spec.name(); }); // </hack> if (std::find(deps.begin(), deps.end(), spec.name()) == deps.end()) continue; |
