aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-07 14:47:27 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-07 15:45:14 -0700
commitc4d5763a537b59ee19d8f91f04d5853d4e257144 (patch)
tree7bdcc16bce0356082bd8f79ae14aa45b18e3421a /toolsrc/src
parentc91ac99d4a29fceb70150f2a00a03da1e16751da (diff)
downloadvcpkg-c4d5763a537b59ee19d8f91f04d5853d4e257144.tar.gz
vcpkg-c4d5763a537b59ee19d8f91f04d5853d4e257144.zip
Fix install plan to not include already installed packages
(unless they are explicitly requested by the user)
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg_Dependencies.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg_Dependencies.cpp
index 76dfb9b29..f3caea600 100644
--- a/toolsrc/src/vcpkg_Dependencies.cpp
+++ b/toolsrc/src/vcpkg_Dependencies.cpp
@@ -70,6 +70,12 @@ namespace vcpkg::Dependencies
for (const std::string& dep_as_string : dependencies_as_string)
{
const PackageSpec current_dep = PackageSpec::from_name_and_triplet(dep_as_string, spec.target_triplet()).value_or_exit(VCPKG_LINE_INFO);
+ auto it = status_db.find_installed(current_dep);
+ if (it != status_db.end())
+ {
+ continue;
+ }
+
graph.add_edge(spec, current_dep);
if (was_examined.find(current_dep) == was_examined.end())
{
@@ -79,8 +85,8 @@ namespace vcpkg::Dependencies
};
const RequestType request_type = specs_as_set.find(spec) != specs_as_set.end() ? RequestType::USER_REQUESTED : RequestType::AUTO_SELECTED;
- auto it = status_db.find(spec);
- if (it != status_db.end() && (*it)->want == Want::INSTALL)
+ auto it = status_db.find_installed(spec);
+ if (it != status_db.end())
{
was_examined.emplace(spec, InstallPlanAction{ InstallPlanType::ALREADY_INSTALLED, request_type, nullopt, nullopt });
continue;