aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-12 21:28:49 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-12 22:05:03 -0700
commit5131e955a809b421345506cd614c8578ab86fa71 (patch)
tree30940906613b8a855eca8c45287f8d7bf235f0fb /toolsrc/include
parent76f2c557ef915a13b37bc9a3ff0f9299373fe923 (diff)
downloadvcpkg-5131e955a809b421345506cd614c8578ab86fa71.tar.gz
vcpkg-5131e955a809b421345506cd614c8578ab86fa71.zip
Simplify Install plan generation
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg_Dependencies.h30
1 files changed, 13 insertions, 17 deletions
diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h
index 47cbb6da3..155fb12e6 100644
--- a/toolsrc/include/vcpkg_Dependencies.h
+++ b/toolsrc/include/vcpkg_Dependencies.h
@@ -9,9 +9,8 @@ namespace vcpkg::Dependencies
{
struct AnyParagraph
{
- std::vector<PackageSpec> dependencies() const;
+ std::vector<PackageSpec> dependencies(const Triplet& triplet) const;
- PackageSpec spec;
Optional<StatusParagraph> status_paragraph;
Optional<BinaryParagraph> binary_paragraph;
Optional<SourceParagraph> source_paragraph;
@@ -36,28 +35,19 @@ namespace vcpkg::Dependencies
struct InstallPlanAction
{
+ static bool compare_by_name(const InstallPlanAction* left, const InstallPlanAction* right);
+
InstallPlanAction();
- explicit InstallPlanAction(const AnyParagraph& any_paragraph, const RequestType& request_type);
- InstallPlanAction(const InstallPlanType& plan_type, const RequestType& request_type, Optional<BinaryParagraph> binary_pgh, Optional<SourceParagraph> source_pgh);
+ explicit InstallPlanAction(const PackageSpec& spec, const AnyParagraph& any_paragraph, const RequestType& request_type);
InstallPlanAction(const InstallPlanAction&) = delete;
InstallPlanAction(InstallPlanAction&&) = default;
InstallPlanAction& operator=(const InstallPlanAction&) = delete;
InstallPlanAction& operator=(InstallPlanAction&&) = default;
+ PackageSpec spec;
+ AnyParagraph any_paragraph;
InstallPlanType plan_type;
RequestType request_type;
- Optional<BinaryParagraph> binary_pgh;
- Optional<SourceParagraph> source_pgh;
- };
-
- struct PackageSpecWithInstallPlan
- {
- static bool compare_by_name(const PackageSpecWithInstallPlan* left, const PackageSpecWithInstallPlan* right);
-
- PackageSpecWithInstallPlan(const PackageSpec& spec, InstallPlanAction&& plan);
-
- PackageSpec spec;
- InstallPlanAction plan;
};
enum class RemovePlanType
@@ -67,6 +57,12 @@ namespace vcpkg::Dependencies
REMOVE
};
+ struct SpecAndRemovePlanType
+ {
+ PackageSpec spec;
+ RemovePlanType plan_type;
+ };
+
struct RemovePlanAction
{
RemovePlanAction();
@@ -90,7 +86,7 @@ namespace vcpkg::Dependencies
RemovePlanAction plan;
};
- std::vector<PackageSpecWithInstallPlan> create_install_plan(const VcpkgPaths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db);
+ std::vector<InstallPlanAction> create_install_plan(const VcpkgPaths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db);
std::vector<PackageSpecWithRemovePlan> create_remove_plan(const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db);
}