mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
PacakgeSpec.toString() -> PackageSpec.to_string()
This commit is contained in:
parent
dac8ace761
commit
818b8a4cfc
@ -19,7 +19,7 @@ namespace vcpkg
|
||||
|
||||
std::string dir() const;
|
||||
|
||||
std::string toString() const;
|
||||
std::string to_string() const;
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
|
@ -60,14 +60,14 @@ namespace vcpkg
|
||||
return Strings::format("%s_%s", this->m_name, this->m_target_triplet);
|
||||
}
|
||||
|
||||
std::string PackageSpec::toString() const
|
||||
std::string PackageSpec::to_string() const
|
||||
{
|
||||
return this->display_name();
|
||||
}
|
||||
|
||||
std::string to_printf_arg(const PackageSpec& spec)
|
||||
{
|
||||
return spec.toString();
|
||||
return spec.to_string();
|
||||
}
|
||||
|
||||
bool operator==(const PackageSpec& left, const PackageSpec& right)
|
||||
@ -77,6 +77,6 @@ namespace vcpkg
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const PackageSpec& spec)
|
||||
{
|
||||
return os << spec.toString();
|
||||
return os << spec.to_string();
|
||||
}
|
||||
}
|
||||
|
@ -68,12 +68,12 @@ namespace vcpkg::Commands::Build
|
||||
|
||||
int return_code = System::cmd_execute_clean(command);
|
||||
auto buildtimeus = timer.microseconds();
|
||||
Metrics::track_metric("buildtimeus-" + spec.toString(), buildtimeus);
|
||||
Metrics::track_metric("buildtimeus-" + spec.to_string(), buildtimeus);
|
||||
|
||||
if (return_code != 0)
|
||||
{
|
||||
Metrics::track_property("error", "build failed");
|
||||
Metrics::track_property("build_error", spec.toString());
|
||||
Metrics::track_property("build_error", spec.to_string());
|
||||
return BuildResult::BUILD_FAILED;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ namespace vcpkg::Commands::Build
|
||||
|
||||
std::string create_error_message(const BuildResult build_result, const PackageSpec& spec)
|
||||
{
|
||||
return Strings::format("Error: Building package %s failed with: %s", spec.toString(), Build::to_string(build_result));
|
||||
return Strings::format("Error: Building package %s failed with: %s", spec.to_string(), Build::to_string(build_result));
|
||||
}
|
||||
|
||||
std::string create_user_troubleshooting_message(const PackageSpec& spec)
|
||||
@ -124,7 +124,7 @@ namespace vcpkg::Commands::Build
|
||||
" Vcpkg version: %s\n"
|
||||
"\n"
|
||||
"Additionally, attach any relevant sections from the log files above."
|
||||
, spec.toString(), Version::version());
|
||||
, spec.to_string(), Version::version());
|
||||
}
|
||||
|
||||
void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set<std::string>& options, const VcpkgPaths& paths)
|
||||
@ -158,7 +158,7 @@ namespace vcpkg::Commands::Build
|
||||
System::println("");
|
||||
for (const PackageSpecWithInstallPlan& p : unmet_dependencies)
|
||||
{
|
||||
System::println(" %s", p.spec.toString());
|
||||
System::println(" %s", p.spec.to_string());
|
||||
}
|
||||
System::println("");
|
||||
Checks::exit_fail(VCPKG_LINE_INFO);
|
||||
|
@ -48,7 +48,7 @@ namespace vcpkg::Commands::CI
|
||||
{
|
||||
const ElapsedTime build_timer = ElapsedTime::create_started();
|
||||
counter++;
|
||||
System::println("Starting package %d/%d: %s", counter, package_count, action.spec.toString());
|
||||
System::println("Starting package %d/%d: %s", counter, package_count, action.spec.to_string());
|
||||
|
||||
timing.push_back(-1);
|
||||
results.push_back(BuildResult::NULLVALUE);
|
||||
@ -99,7 +99,7 @@ namespace vcpkg::Commands::CI
|
||||
|
||||
for (size_t i = 0; i < results.size(); i++)
|
||||
{
|
||||
System::println("%s: %s: %dms", install_plan[i].spec.toString(), Build::to_string(results[i]), timing[i]);
|
||||
System::println("%s: %s: %dms", install_plan[i].spec.to_string(), Build::to_string(results[i]), timing[i]);
|
||||
}
|
||||
|
||||
std::map<BuildResult, int> summary;
|
||||
|
@ -204,11 +204,11 @@ namespace vcpkg::Commands::Install
|
||||
Checks::check_exit(VCPKG_LINE_INFO, !install_plan.empty(), "Install plan cannot be empty");
|
||||
|
||||
// log the plan
|
||||
std::string specs_string = install_plan[0].spec.toString();
|
||||
std::string specs_string = install_plan[0].spec.to_string();
|
||||
for (size_t i = 1; i < install_plan.size(); ++i)
|
||||
{
|
||||
specs_string.push_back(',');
|
||||
specs_string.append(install_plan[i].spec.toString());
|
||||
specs_string.append(install_plan[i].spec.to_string());
|
||||
}
|
||||
Metrics::track_property("installplan", specs_string);
|
||||
|
||||
|
@ -137,7 +137,7 @@ namespace vcpkg::Commands::Remove
|
||||
System::println("The following packages are not installed, so not removed:\n%s",
|
||||
Strings::join("\n ", not_installed, [](const PackageSpecWithRemovePlan* p)
|
||||
{
|
||||
return " " + p->spec.toString();
|
||||
return " " + p->spec.to_string();
|
||||
}));
|
||||
}
|
||||
|
||||
@ -149,12 +149,12 @@ namespace vcpkg::Commands::Remove
|
||||
{
|
||||
if (p->plan.request_type == Dependencies::RequestType::AUTO_SELECTED)
|
||||
{
|
||||
return " * " + p->spec.toString();
|
||||
return " * " + p->spec.to_string();
|
||||
}
|
||||
|
||||
if (p->plan.request_type == Dependencies::RequestType::USER_REQUESTED)
|
||||
{
|
||||
return " " + p->spec.toString();
|
||||
return " " + p->spec.to_string();
|
||||
}
|
||||
|
||||
Checks::unreachable(VCPKG_LINE_INFO);
|
||||
|
Loading…
x
Reference in New Issue
Block a user