2016-09-22 23:28:50 -07:00
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "package_spec.h"
|
|
|
|
#include "StatusParagraphs.h"
|
|
|
|
#include "vcpkg_paths.h"
|
2017-01-30 16:14:48 -08:00
|
|
|
#include "vcpkg_optional.h"
|
2016-09-22 23:28:50 -07:00
|
|
|
|
2017-01-05 14:14:11 -08:00
|
|
|
namespace vcpkg::Dependencies
|
2016-09-22 23:28:50 -07:00
|
|
|
{
|
2017-01-30 13:57:43 -08:00
|
|
|
enum class request_type
|
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
UNKNOWN,
|
2017-01-30 13:57:43 -08:00
|
|
|
USER_REQUESTED,
|
|
|
|
AUTO_SELECTED
|
|
|
|
};
|
|
|
|
|
2016-11-15 11:56:46 -08:00
|
|
|
enum class install_plan_type
|
2016-11-15 11:56:46 -08:00
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
UNKNOWN,
|
2016-11-15 11:56:46 -08:00
|
|
|
BUILD_AND_INSTALL,
|
|
|
|
INSTALL,
|
|
|
|
ALREADY_INSTALLED
|
|
|
|
};
|
2016-09-22 23:28:50 -07:00
|
|
|
|
2016-11-15 11:56:46 -08:00
|
|
|
struct install_plan_action
|
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
install_plan_action();
|
|
|
|
install_plan_action(const install_plan_type& plan_type, optional<BinaryParagraph> binary_pgh, optional<SourceParagraph> source_pgh);
|
|
|
|
install_plan_action(const install_plan_action&) = delete;
|
|
|
|
install_plan_action(install_plan_action&&) = default;
|
|
|
|
install_plan_action& operator=(const install_plan_action&) = delete;
|
|
|
|
install_plan_action& operator=(install_plan_action&&) = default;
|
|
|
|
|
2017-01-30 13:58:58 -08:00
|
|
|
install_plan_type plan_type;
|
2017-01-30 16:14:48 -08:00
|
|
|
optional<BinaryParagraph> binary_pgh;
|
|
|
|
optional<SourceParagraph> source_pgh;
|
2016-11-15 11:56:46 -08:00
|
|
|
};
|
2016-11-07 16:38:49 -08:00
|
|
|
|
2016-11-15 11:56:46 -08:00
|
|
|
struct package_spec_with_install_plan
|
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
package_spec_with_install_plan(const package_spec& spec, install_plan_action&& plan);
|
|
|
|
|
2016-11-15 11:56:46 -08:00
|
|
|
package_spec spec;
|
2016-11-15 11:56:46 -08:00
|
|
|
install_plan_action plan;
|
2016-11-15 11:56:46 -08:00
|
|
|
};
|
|
|
|
|
2017-01-26 14:25:36 -08:00
|
|
|
enum class remove_plan_type
|
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
UNKNOWN,
|
2017-01-26 14:25:36 -08:00
|
|
|
NOT_INSTALLED,
|
2017-01-30 13:57:43 -08:00
|
|
|
REMOVE
|
2017-01-26 14:25:36 -08:00
|
|
|
};
|
|
|
|
|
2017-01-26 17:53:45 -08:00
|
|
|
struct remove_plan_action
|
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
remove_plan_action();
|
|
|
|
remove_plan_action(const remove_plan_type& plan_type, const request_type& request_type);
|
|
|
|
remove_plan_action(const remove_plan_action&) = delete;
|
|
|
|
remove_plan_action(remove_plan_action&&) = default;
|
|
|
|
remove_plan_action& operator=(const remove_plan_action&) = delete;
|
|
|
|
remove_plan_action& operator=(remove_plan_action&&) = default;
|
|
|
|
|
|
|
|
|
2017-01-30 13:57:43 -08:00
|
|
|
remove_plan_type plan_type;
|
|
|
|
request_type request_type;
|
2017-01-26 17:53:45 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct package_spec_with_remove_plan
|
|
|
|
{
|
2017-01-30 17:52:53 -08:00
|
|
|
package_spec_with_remove_plan(const package_spec& spec, remove_plan_action&& plan);
|
|
|
|
|
2017-01-26 17:53:45 -08:00
|
|
|
package_spec spec;
|
|
|
|
remove_plan_action plan;
|
|
|
|
};
|
2017-01-26 14:25:36 -08:00
|
|
|
|
2016-11-15 11:56:46 -08:00
|
|
|
std::vector<package_spec_with_install_plan> create_install_plan(const vcpkg_paths& paths, const std::vector<package_spec>& specs, const StatusParagraphs& status_db);
|
2017-01-26 17:53:45 -08:00
|
|
|
|
2017-02-15 18:38:40 -08:00
|
|
|
std::vector<package_spec_with_remove_plan> create_remove_plan(const std::vector<package_spec>& specs, const StatusParagraphs& status_db);
|
2017-01-05 14:14:11 -08:00
|
|
|
}
|