diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-27 16:14:36 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-27 16:14:36 -0800 |
| commit | 54859c0f1f201dfcc78e783c77c3b477d0c86c92 (patch) | |
| tree | 6723e6c34f27ed98c41fd14fce4275de92f473ea /toolsrc/src/commands_update.cpp | |
| parent | b7bd8c3251dcb9ecf3f6c0201c2a513596ab09b1 (diff) | |
| download | vcpkg-54859c0f1f201dfcc78e783c77c3b477d0c86c92.tar.gz vcpkg-54859c0f1f201dfcc78e783c77c3b477d0c86c92.zip | |
Introduce extract_port_names_and_versions()
Diffstat (limited to 'toolsrc/src/commands_update.cpp')
| -rw-r--r-- | toolsrc/src/commands_update.cpp | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/commands_update.cpp index d4519ca14..8131d9a73 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/commands_update.cpp @@ -15,25 +15,8 @@ namespace vcpkg::Commands::Update auto status_db = database_load_check(paths); - std::unordered_map<std::string, std::string> src_names_to_versions; - - auto begin_it = fs::directory_iterator(paths.ports); - auto end_it = fs::directory_iterator(); - for (; begin_it != end_it; ++begin_it) - { - const auto& path = begin_it->path(); - try - { - auto pghs = Paragraphs::get_paragraphs(path / "CONTROL"); - if (pghs.empty()) - continue; - auto srcpgh = SourceParagraph(pghs[0]); - src_names_to_versions.emplace(srcpgh.name, srcpgh.version); - } - catch (std::runtime_error const&) - { - } - } + const std::vector<SourceParagraph> source_paragraphs = Paragraphs::load_all_ports(paths.ports); + const std::map<std::string, std::string> src_names_to_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs); std::string packages_list; |
