diff options
| author | Daniel Shaw <t-dansha@microsoft.com> | 2017-07-19 14:19:11 -0700 |
|---|---|---|
| committer | Daniel Shaw <t-dansha@microsoft.com> | 2017-07-19 14:19:11 -0700 |
| commit | 1445115906139f5c6d14bcbbacdcc0cfb543fd80 (patch) | |
| tree | 8197c502f3b824cdbfadbc218daa99bdc11d254a /toolsrc/include | |
| parent | 7cca4a2d59124070661d69912288d73758ed4f94 (diff) | |
| download | vcpkg-1445115906139f5c6d14bcbbacdcc0cfb543fd80.tar.gz vcpkg-1445115906139f5c6d14bcbbacdcc0cfb543fd80.zip | |
refactor feature packages
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Dependencies.h | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 92523a654..ff559c0f1 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -44,20 +44,20 @@ namespace vcpkg::Dependencies struct FeatureNodeEdges { - std::vector<FeatureSpec> dotted; - std::vector<FeatureSpec> dashed; + std::vector<FeatureSpec> remove_edges; + std::vector<FeatureSpec> build_edges; bool plus = false; }; std::vector<FeatureSpec> to_feature_specs(const std::vector<std::string> depends, const std::unordered_map<std::string, PackageSpec> str_to_spec); struct Cluster { - ClusterNode cluster_node; + ClusterNode cluster_data; std::unordered_map<std::string, FeatureNodeEdges> edges; - std::unordered_set<std::string> tracked_nodes; - std::unordered_set<std::string> original_nodes; - bool minus = false; - bool zero = true; + std::unordered_set<std::string> to_install_features; + std::unordered_set<std::string> original_features; + bool will_remove = false; + bool transient_uninstalled = true; Cluster() = default; private: @@ -81,7 +81,7 @@ namespace vcpkg::Dependencies InstallPlanAction(const PackageSpec& spec, const AnyParagraph& any_paragraph, const RequestType& request_type); InstallPlanAction(const PackageSpec& spec, const SourceControlFile& any_paragraph, - std::unordered_set<std::string> features, + const std::unordered_set<std::string>& features, const RequestType& request_type); InstallPlanAction(const InstallPlanAction&) = delete; InstallPlanAction(InstallPlanAction&&) = default; @@ -163,6 +163,10 @@ namespace vcpkg::Dependencies mutable std::unordered_map<PackageSpec, SourceControlFile> cache; explicit PathsPortFile(const VcpkgPaths& paths); const SourceControlFile& get_control_file(const PackageSpec& spec) const override; + + private: + PathsPortFile(const PathsPortFile&) = delete; + PathsPortFile& operator=(const PathsPortFile&) = delete; }; std::vector<InstallPlanAction> create_install_plan(const PortFileProvider& port_file_provider, @@ -177,26 +181,6 @@ namespace vcpkg::Dependencies const StatusParagraphs& status_db); } -template<> -struct std::hash<vcpkg::Dependencies::Cluster> -{ - size_t operator()(const vcpkg::Dependencies::Cluster& value) const - { - size_t hash = 17; - if (auto source = value.cluster_node.source_paragraph.get()) - { - hash = hash * 31 + std::hash<std::string>()((*source)->core_paragraph->name); - } - else if (!value.cluster_node.status_paragraphs.empty()) - { - auto start = *value.cluster_node.status_paragraphs.begin(); - hash = hash * 31 + std::hash<std::string>()(start.package.displayname()); - } - - return hash; - } -}; - namespace vcpkg::Dependencies { struct GraphPlan |
