aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg_Dependencies.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h
index 018c4f5cf..da31aa4bf 100644
--- a/toolsrc/include/vcpkg_Dependencies.h
+++ b/toolsrc/include/vcpkg_Dependencies.h
@@ -97,7 +97,24 @@ namespace vcpkg::Dependencies
RequestType request_type;
};
- std::vector<InstallPlanAction> create_install_plan(const VcpkgPaths& paths,
+ __interface PortFileProvider { virtual const SourceControlFile* get_control_file(const PackageSpec& spec) const; };
+
+ struct MapPortFile : PortFileProvider
+ {
+ const std::unordered_map<PackageSpec, SourceControlFile>& ports;
+ explicit MapPortFile(const std::unordered_map<PackageSpec, SourceControlFile>& map);
+ const SourceControlFile* get_control_file(const PackageSpec& spec) const override;
+ };
+
+ struct PathsPortFile : PortFileProvider
+ {
+ const VcpkgPaths& ports;
+ mutable std::unordered_map<PackageSpec, SourceControlFile> cache;
+ explicit PathsPortFile(const VcpkgPaths& paths);
+ const SourceControlFile* get_control_file(const PackageSpec& spec) const override;
+ };
+
+ std::vector<InstallPlanAction> create_install_plan(const PortFileProvider& port_file_provider,
const std::vector<PackageSpec>& specs,
const StatusParagraphs& status_db);