Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make print_plan actually print. #1415

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/vcpkg/dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,5 @@ namespace vcpkg

FormattedPlan format_plan(const ActionPlan& action_plan, const Path& builtin_ports_dir);

void print_plan(const ActionPlan& action_plan, const bool is_recursive, const Path& builtin_ports_dir);
FormattedPlan print_plan(const ActionPlan& action_plan, const Path& builtin_ports_dir);
}
2 changes: 1 addition & 1 deletion src/vcpkg/commands.ci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ namespace vcpkg

if (is_dry_run)
{
print_plan(action_plan, true, paths.builtin_ports_directory());
print_plan(action_plan, paths.builtin_ports_directory());
if (!regressions.empty())
{
msg::println(Color::error, msgCiBaselineRegressionHeader);
Expand Down
7 changes: 6 additions & 1 deletion src/vcpkg/commands.install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,12 @@ namespace vcpkg
}
#endif // defined(_WIN32)

print_plan(action_plan, is_recursive, paths.builtin_ports_directory());
const auto formatted = print_plan(action_plan, paths.builtin_ports_directory());
if (!is_recursive && formatted.has_removals)
{
msg::println_warning(msgPackagesToRebuildSuggestRecurse);
Checks::exit_fail(VCPKG_LINE_INFO);
}

auto it_pkgsconfig = options.settings.find(SwitchXWriteNuGetPackagesConfig);
if (it_pkgsconfig != options.settings.end())
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/commands.set-installed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ namespace vcpkg
auto status_db = database_load_check(fs, paths.installed());
adjust_action_plan_to_status_db(action_plan, status_db);

print_plan(action_plan, true, paths.builtin_ports_directory());
print_plan(action_plan, paths.builtin_ports_directory());

if (auto p_pkgsconfig = maybe_pkgconfig.get())
{
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg/commands.upgrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace vcpkg

Checks::check_exit(VCPKG_LINE_INFO, !action_plan.empty());
action_plan.print_unsupported_warnings();
print_plan(action_plan, true, paths.builtin_ports_directory());
print_plan(action_plan, paths.builtin_ports_directory());

if (!no_dry_run)
{
Expand Down
8 changes: 2 additions & 6 deletions src/vcpkg/dependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1316,15 +1316,11 @@ namespace vcpkg
return ret;
}

void print_plan(const ActionPlan& action_plan, const bool is_recursive, const Path& builtin_ports_dir)
FormattedPlan print_plan(const ActionPlan& action_plan, const Path& builtin_ports_dir)
{
auto formatted = format_plan(action_plan, builtin_ports_dir);
msg::print(formatted.text);
if (!is_recursive && formatted.has_removals)
{
msg::println_warning(msgPackagesToRebuildSuggestRecurse);
Checks::exit_fail(VCPKG_LINE_INFO);
}
return formatted;
}

namespace
Expand Down
Loading