diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-07 16:38:49 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-07 16:38:49 -0800 |
| commit | 8be5e7c123d241cd4a71d03acdf43ceccf57ded2 (patch) | |
| tree | 11577074b220ebec94fac7e37a49e89307bbd0bf /toolsrc/src/vcpkg.cpp | |
| parent | 5c769e462b377ce06ad46998794a189f3a1b55bc (diff) | |
| download | vcpkg-8be5e7c123d241cd4a71d03acdf43ceccf57ded2.tar.gz vcpkg-8be5e7c123d241cd4a71d03acdf43ceccf57ded2.zip | |
Move Dependency-related functions from vcpkg.h to vcpkg_Dependencies.h
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 3e1f16179..bd02f5424 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -216,50 +216,6 @@ static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryPar listfile.close(); } -// TODO: Refactoring between this function and install_package -std::vector<std::string> vcpkg::get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) -{ - const fs::path packages_dir_control_file_path = paths.package_dir(spec) / "CONTROL"; - - auto control_contents_maybe = Files::get_contents(packages_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector<std::unordered_map<std::string, std::string>> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", packages_dir_control_file_path.string()); - return BinaryParagraph(pghs[0]).depends; - } - - return get_unmet_package_build_dependencies(paths, spec, status_db); -} - -std::vector<std::string> vcpkg::get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db) -{ - const fs::path ports_dir_control_file_path = paths.port_dir(spec) / "CONTROL"; - auto control_contents_maybe = Files::get_contents(ports_dir_control_file_path); - if (auto control_contents = control_contents_maybe.get()) - { - std::vector<std::unordered_map<std::string, std::string>> pghs; - try - { - pghs = Paragraphs::parse_paragraphs(*control_contents); - } - catch (std::runtime_error) - { - } - Checks::check_exit(pghs.size() == 1, "Invalid control file at %s", ports_dir_control_file_path.string()); - return filter_dependencies(SourceParagraph(pghs[0]).depends, spec.target_triplet()); - } - - Checks::exit_with_message("Could not find package named %s", spec); -} - void vcpkg::install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db) { StatusParagraph spgh; |
