aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-11-15 11:56:46 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2016-11-15 11:58:13 -0800
commit2584f3e3def7f09bc373117985013ac019aa76d6 (patch)
tree6ef2e0b666bd7917b644d420abdad77e6c667d6f /toolsrc/include
parenta72be4b6b9b63a7a11f507782c1c26fdd2b18ad0 (diff)
downloadvcpkg-2584f3e3def7f09bc373117985013ac019aa76d6.tar.gz
vcpkg-2584f3e3def7f09bc373117985013ac019aa76d6.zip
Major refactor/rework of dependency resolution
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/StatusParagraphs.h4
-rw-r--r--toolsrc/include/vcpkg.h9
-rw-r--r--toolsrc/include/vcpkg_Dependencies.h17
3 files changed, 26 insertions, 4 deletions
diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h
index 9446d432c..7a0f2177d 100644
--- a/toolsrc/include/StatusParagraphs.h
+++ b/toolsrc/include/StatusParagraphs.h
@@ -13,6 +13,10 @@ namespace vcpkg
using iterator = container::reverse_iterator;
using const_iterator = container::const_reverse_iterator;
+ const_iterator find(const package_spec& spec) const
+ {
+ return find(spec.name(), spec.target_triplet());
+ }
const_iterator find(const std::string& name, const triplet& target_triplet) const;
iterator find(const std::string& name, const triplet& target_triplet);
iterator find_installed(const std::string& name, const triplet& target_triplet);
diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h
index 1d7f87d32..81b4d45ba 100644
--- a/toolsrc/include/vcpkg.h
+++ b/toolsrc/include/vcpkg.h
@@ -16,4 +16,13 @@ namespace vcpkg
void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db);
void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db);
+
+ expected<SourceParagraph> try_load_port(const fs::path& control_path);
+ inline expected<SourceParagraph> try_load_port(const vcpkg_paths& paths, const std::string& name)
+ {
+ return try_load_port(paths.ports / name);
+ }
+
+ expected<BinaryParagraph> try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec);
+
} // namespace vcpkg
diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h
index 8e6808ee3..b556eb7d8 100644
--- a/toolsrc/include/vcpkg_Dependencies.h
+++ b/toolsrc/include/vcpkg_Dependencies.h
@@ -2,14 +2,23 @@
#include <vector>
#include "package_spec.h"
#include "StatusParagraphs.h"
-#include <unordered_set>
#include "vcpkg_paths.h"
namespace vcpkg {namespace Dependencies
{
- std::vector<package_spec> create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector<package_spec>& specs, const StatusParagraphs& status_db);
+ enum class install_plan_kind
+ {
+ BUILD_AND_INSTALL,
+ INSTALL,
+ ALREADY_INSTALLED
+ };
- std::unordered_set<package_spec> get_unmet_dependencies(const vcpkg_paths& paths, const std::vector<package_spec>& specs, const StatusParagraphs& status_db);
+ struct install_plan_action
+ {
+ install_plan_kind plan;
+ std::unique_ptr<BinaryParagraph> bpgh;
+ std::unique_ptr<SourceParagraph> spgh;
+ };
- std::vector<std::string> get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec);
+ std::vector<std::pair<package_spec, install_plan_action>> create_install_plan(const vcpkg_paths& paths, const std::vector<package_spec>& specs, const StatusParagraphs& status_db);
}}