aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-12-13 04:48:13 -0800
committerRobert Schumacher <roschuma@microsoft.com>2017-12-13 04:48:13 -0800
commit7a6ffdc75c6634e0df3c158e871426190511a096 (patch)
tree5993bcddb76841caf16aa5c6160b5c8fe89e0b66 /toolsrc/include
parente6b16165e7d69feab3f4841ab702e6072199b9d4 (diff)
downloadvcpkg-7a6ffdc75c6634e0df3c158e871426190511a096.tar.gz
vcpkg-7a6ffdc75c6634e0df3c158e871426190511a096.zip
Revert "[vcpkg-upgrade] Initial commit of upgrade command."
This reverts commit 803347a0c545687f6e6b8b3594b52d11435491b3.
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/tests.utils.h16
-rw-r--r--toolsrc/include/vcpkg/commands.h6
-rw-r--r--toolsrc/include/vcpkg/dependencies.h50
-rw-r--r--toolsrc/include/vcpkg/paragraphs.h3
-rw-r--r--toolsrc/include/vcpkg/update.h6
5 files changed, 17 insertions, 64 deletions
diff --git a/toolsrc/include/tests.utils.h b/toolsrc/include/tests.utils.h
index 0c0add7ab..485b8c294 100644
--- a/toolsrc/include/tests.utils.h
+++ b/toolsrc/include/tests.utils.h
@@ -23,18 +23,4 @@ std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name,
std::unique_ptr<vcpkg::StatusParagraph> make_status_feature_pgh(const char* name,
const char* feature,
const char* depends = "",
- const char* triplet = "x86-windows");
-
-template<class T, class S>
-T&& unwrap(vcpkg::ExpectedT<T, S>&& p)
-{
- Assert::IsTrue(p.has_value());
- return std::move(*p.get());
-}
-
-template<class T>
-T&& unwrap(vcpkg::Optional<T>&& opt)
-{
- Assert::IsTrue(opt.has_value());
- return std::move(*opt.get());
-}
+ const char* triplet = "x86-windows"); \ No newline at end of file
diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h
index b852a973e..74fd80c03 100644
--- a/toolsrc/include/vcpkg/commands.h
+++ b/toolsrc/include/vcpkg/commands.h
@@ -39,12 +39,6 @@ namespace vcpkg::Commands
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
- namespace Upgrade
- {
- extern const CommandStructure COMMAND_STRUCTURE;
- void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
- }
-
namespace Edit
{
extern const CommandStructure COMMAND_STRUCTURE;
diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h
index f1249dc88..5411ee166 100644
--- a/toolsrc/include/vcpkg/dependencies.h
+++ b/toolsrc/include/vcpkg/dependencies.h
@@ -92,11 +92,11 @@ namespace vcpkg::Dependencies
struct AnyAction
{
- AnyAction(InstallPlanAction&& iplan) : install_action(std::move(iplan)) {}
- AnyAction(RemovePlanAction&& rplan) : remove_action(std::move(rplan)) {}
+ AnyAction(InstallPlanAction&& iplan) : install_plan(std::move(iplan)) {}
+ AnyAction(RemovePlanAction&& rplan) : remove_plan(std::move(rplan)) {}
- Optional<InstallPlanAction> install_action;
- Optional<RemovePlanAction> remove_action;
+ Optional<InstallPlanAction> install_plan;
+ Optional<RemovePlanAction> remove_plan;
const PackageSpec& spec() const;
};
@@ -123,44 +123,22 @@ namespace vcpkg::Dependencies
struct PortFileProvider
{
- virtual Optional<const SourceControlFile&> get_control_file(const std::string& src_name) const = 0;
+ virtual const SourceControlFile& get_control_file(const std::string& spec) const = 0;
};
- struct MapPortFileProvider : Util::ResourceBase, PortFileProvider
+ struct MapPortFile : Util::ResourceBase, PortFileProvider
{
- explicit MapPortFileProvider(const std::unordered_map<std::string, SourceControlFile>& map);
- Optional<const SourceControlFile&> get_control_file(const std::string& src_name) const override;
-
- private:
const std::unordered_map<std::string, SourceControlFile>& ports;
+ explicit MapPortFile(const std::unordered_map<std::string, SourceControlFile>& map);
+ const SourceControlFile& get_control_file(const std::string& spec) const override;
};
- struct PathsPortFileProvider : Util::ResourceBase, PortFileProvider
+ struct PathsPortFile : Util::ResourceBase, PortFileProvider
{
- explicit PathsPortFileProvider(const VcpkgPaths& paths);
- Optional<const SourceControlFile&> get_control_file(const std::string& src_name) const override;
-
- private:
const VcpkgPaths& ports;
mutable std::unordered_map<std::string, SourceControlFile> cache;
- };
-
- struct ClusterGraph;
- struct GraphPlan;
-
- struct PackageGraph
- {
- PackageGraph(const PortFileProvider& provider, const StatusParagraphs& status_db);
- ~PackageGraph();
-
- void install(const FeatureSpec& spec);
- void upgrade(const PackageSpec& spec);
-
- std::vector<AnyAction> serialize() const;
-
- private:
- std::unique_ptr<GraphPlan> m_graph_plan;
- std::unique_ptr<ClusterGraph> m_graph;
+ explicit PathsPortFile(const VcpkgPaths& paths);
+ const SourceControlFile& get_control_file(const std::string& spec) const override;
};
std::vector<InstallPlanAction> create_install_plan(const PortFileProvider& port_file_provider,
@@ -177,10 +155,4 @@ namespace vcpkg::Dependencies
std::vector<AnyAction> create_feature_install_plan(const std::unordered_map<std::string, SourceControlFile>& map,
const std::vector<FeatureSpec>& specs,
const StatusParagraphs& status_db);
-
- std::vector<AnyAction> create_feature_install_plan(const PortFileProvider& port_file_provider,
- const std::vector<FeatureSpec>& specs,
- const StatusParagraphs& status_db);
-
- void print_plan(const std::vector<AnyAction>& action_plan, const bool is_recursive = true);
}
diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h
index e2c7f2d99..c8dbea646 100644
--- a/toolsrc/include/vcpkg/paragraphs.h
+++ b/toolsrc/include/vcpkg/paragraphs.h
@@ -32,4 +32,7 @@ namespace vcpkg::Paragraphs
std::vector<std::unique_ptr<SourceControlFile>> load_all_ports(const Files::Filesystem& fs,
const fs::path& ports_dir);
+
+ std::map<std::string, VersionT> load_all_port_names_and_versions(const Files::Filesystem& fs,
+ const fs::path& ports_dir);
}
diff --git a/toolsrc/include/vcpkg/update.h b/toolsrc/include/vcpkg/update.h
index b85f7b2b3..7587b9eb2 100644
--- a/toolsrc/include/vcpkg/update.h
+++ b/toolsrc/include/vcpkg/update.h
@@ -1,6 +1,5 @@
#pragma once
-#include <vcpkg/dependencies.h>
#include <vcpkg/packagespec.h>
#include <vcpkg/statusparagraphs.h>
#include <vcpkg/vcpkgcmdarguments.h>
@@ -17,8 +16,7 @@ namespace vcpkg::Update
VersionDiff version_diff;
};
- std::vector<OutdatedPackage> find_outdated_packages(const Dependencies::PortFileProvider& provider,
+ std::vector<OutdatedPackage> find_outdated_packages(const std::map<std::string, VersionT>& src_names_to_versions,
const StatusParagraphs& status_db);
-
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
-}
+} \ No newline at end of file