[vcpkg] Update hint message (#12976)

This commit is contained in:
Phoebe 2020-08-19 17:34:43 -07:00 committed by GitHub
parent 5e164e3dd2
commit 680b2928a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 10 deletions

View File

@ -1086,12 +1086,18 @@ namespace vcpkg::Build
std::string create_user_troubleshooting_message(const PackageSpec& spec)
{
return Strings::format("Please ensure you're using the latest portfiles with `.\\vcpkg update`, then\n"
#if defined(_WIN32)
auto vcpkg_update_cmd = ".\\vcpkg";
#else
auto vcpkg_update_cmd = ".\/vcpkg";
#endif
return Strings::format("Please ensure you're using the latest portfiles with `%s update`, then\n"
"submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n"
" Package: %s\n"
" Vcpkg version: %s\n"
"\n"
"Additionally, attach any relevant sections from the log files above.",
vcpkg_update_cmd,
spec,
Commands::Version::version());
}

View File

@ -61,15 +61,21 @@ namespace vcpkg::Commands::Version
{
if (maj1 != maj2 || min1 != min2 || rev1 != rev2)
{
#if defined(_WIN32)
auto bootstrap = ".\\bootstrap-vcpkg.bat";
#else
auto bootstrap = ".\/bootstrap-vcpkg.sh";
#endif
System::printf(System::Color::warning,
"Warning: Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use "
".\\bootstrap-vcpkg.bat to update.\n",
"%s to update.\n",
maj2,
min2,
rev2,
maj1,
min1,
rev1);
rev1,
bootstrap);
}
}
}

View File

@ -257,13 +257,18 @@ namespace vcpkg::Dependencies
{
ExpectedS<const SourceControlFileLocation&> maybe_scfl =
m_port_provider.get_control_file(ipv.spec().name());
#if defined(_WIN32)
auto vcpkg_remove_cmd = ".\\vcpkg";
#else
auto vcpkg_remove_cmd = ".\/vcpkg";
#endif
if (!maybe_scfl)
Checks::exit_with_message(
VCPKG_LINE_INFO,
"Error: while loading %s: %s.\nPlease run \"vcpkg remove %s\" and re-attempt.",
"Error: while loading %s: %s.\nPlease run \"%s remove %s\" and re-attempt.",
ipv.spec().to_string(),
maybe_scfl.error(),
vcpkg_remove_cmd,
ipv.spec().to_string());
return m_graph

View File

@ -179,8 +179,12 @@ namespace vcpkg
System::print2("And this is the list of valid fields for manifest files: \n\n ",
Strings::join("\n ", get_list_of_manifest_fields()),
"\n\n");
System::print2("You may need to update the vcpkg binary; try running bootstrap-vcpkg.bat or "
"bootstrap-vcpkg.sh to update.\n\n");
#if defined(_WIN32)
auto bootstrap = ".\\bootstrap-vcpkg.bat";
#else
auto bootstrap = ".\/bootstrap-vcpkg.sh";
#endif
System::print2("You may need to update the vcpkg binary; try running %s to update.\n\n", bootstrap);
}
for (auto&& error_info : error_info_list)

View File

@ -74,13 +74,21 @@ namespace vcpkg::Update
{
System::printf(" %-32s %s\n", package.spec, package.version_diff.to_string());
}
#if defined(_WIN32)
auto vcpkg_cmd = ".\\vcpkg";
#else
auto vcpkg_cmd = ".\/vcpkg";
#endif
System::print2("\n"
"To update these packages and all dependencies, run\n"
" .\\vcpkg upgrade\n"
" %s upgrade\n"
"\n"
"To only remove outdated packages, run\n"
" .\\vcpkg remove --outdated\n"
"\n");
" %s remove --outdated\n"
"\n",
vcpkg_cmd,
vcpkg_cmd);
}
Checks::exit_success(VCPKG_LINE_INFO);