aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/Paragraphs.cpp18
-rw-r--r--toolsrc/src/commands_install.cpp4
-rw-r--r--toolsrc/src/commands_search.cpp21
3 files changed, 18 insertions, 25 deletions
diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp
index a7dee4fd3..6a6f191df 100644
--- a/toolsrc/src/Paragraphs.cpp
+++ b/toolsrc/src/Paragraphs.cpp
@@ -254,7 +254,7 @@ namespace vcpkg::Paragraphs
for (auto&& path : fs.get_files_non_recursive(ports_dir))
{
auto maybe_spgh = try_load_port(fs, path);
- if (auto spgh = maybe_spgh.get())
+ if (const auto spgh = maybe_spgh.get())
{
ret.paragraphs.emplace_back(std::move(*spgh));
}
@@ -272,8 +272,20 @@ namespace vcpkg::Paragraphs
auto results = try_load_all_ports(fs, ports_dir);
if (!results.errors.empty())
{
- print_error_message(results.errors);
- Checks::exit_fail(VCPKG_LINE_INFO);
+ if (GlobalState::debugging)
+ {
+ print_error_message(results.errors);
+ }
+ else
+ {
+ for (auto&& error : results.errors)
+ {
+ System::println(
+ System::Color::warning, "Warning: an error occurred while parsing '%s'", error->name);
+ }
+ System::println(System::Color::warning,
+ "Use '--debug' to get more information about the parse failures.\n");
+ }
}
return std::move(results.paragraphs);
}
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp
index aca25996e..d815332fe 100644
--- a/toolsrc/src/commands_install.cpp
+++ b/toolsrc/src/commands_install.cpp
@@ -568,8 +568,8 @@ namespace vcpkg::Commands::Install
if (GlobalState::feature_packages)
{
std::unordered_map<std::string, SourceControlFile> scf_map;
- auto all_ports = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports);
- for (auto&& port : all_ports.paragraphs)
+ auto all_ports = Paragraphs::load_all_ports(paths.get_filesystem(), paths.ports);
+ for (auto&& port : all_ports)
{
scf_map[port->core_paragraph->name] = std::move(*port);
}
diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/commands_search.cpp
index 1ccec9fbe..d35a546c4 100644
--- a/toolsrc/src/commands_search.cpp
+++ b/toolsrc/src/commands_search.cpp
@@ -87,27 +87,8 @@ namespace vcpkg::Commands::Search
const std::unordered_set<std::string> options =
args.check_and_get_optional_command_arguments({OPTION_GRAPH, OPTION_FULLDESC});
- auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports);
+ auto source_paragraphs = Paragraphs::load_all_ports(paths.get_filesystem(), paths.ports);
- if (!sources_and_errors.errors.empty())
- {
- if (GlobalState::debugging)
- {
- print_error_message(sources_and_errors.errors);
- }
- else
- {
- for (auto&& error : sources_and_errors.errors)
- {
- System::println(
- System::Color::warning, "Warning: an error occurred while parsing '%s'", error->name);
- }
- System::println(System::Color::warning,
- "Use '--debug' to get more information about the parse failures.\n");
- }
- }
-
- auto& source_paragraphs = sources_and_errors.paragraphs;
if (options.find(OPTION_GRAPH) != options.cend())
{
const std::string graph_as_string = create_graph_as_string(source_paragraphs);