Remove PackageSpec.display_name()
MODIFY
include/PackageSpec.h
include/PackageSpec.h
@@ -15,8 +15,6 @@ namespace vcpkg
const Triplet& target_triplet() const;
- std::string display_name() const;
-
std::string dir() const;
std::string to_string() const;

MODIFY
src/BinaryParagraph.cpp
src/BinaryParagraph.cpp
@@ -55,7 +55,7 @@ namespace vcpkg
std::string BinaryParagraph::displayname() const
{
- return this->spec.display_name();
+ return this->spec.to_string();
}
std::string BinaryParagraph::dir() const

MODIFY
src/PackageSpec.cpp
src/PackageSpec.cpp
@@ -50,11 +50,6 @@ namespace vcpkg
return this->m_target_triplet;
}
- std::string PackageSpec::display_name() const
- {
- return Strings::format("%s:%s", this->name(), this->target_triplet());
- }
-
std::string PackageSpec::dir() const
{
return Strings::format("%s_%s", this->m_name, this->m_target_triplet);
@@ -62,7 +57,7 @@ namespace vcpkg
std::string PackageSpec::to_string() const
{
- return this->display_name();
+ return Strings::format("%s:%s", this->name(), this->target_triplet());
}
bool operator==(const PackageSpec& left, const PackageSpec& right)

MODIFY
src/commands_build.cpp
src/commands_build.cpp
@@ -141,7 +141,7 @@ namespace vcpkg::Commands::Build
}
const Expected<SourceParagraph> maybe_spgh = Paragraphs::try_load_port(port_dir);
- Checks::check_exit(VCPKG_LINE_INFO, !maybe_spgh.error_code(), "Could not find package named %s: %s", spec.display_name(), maybe_spgh.error_code().message());
+ Checks::check_exit(VCPKG_LINE_INFO, !maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message());
const SourceParagraph& spgh = *maybe_spgh.get();
StatusParagraphs status_db = database_load_check(paths);

MODIFY
src/commands_ci.cpp
src/commands_ci.cpp
@@ -48,7 +48,7 @@ namespace vcpkg::Commands::CI
{
const ElapsedTime build_timer = ElapsedTime::create_started();
counter++;
- const std::string display_name = action.spec.display_name();
+ const std::string display_name = action.spec.to_string();
System::println("Starting package %d/%d: %s", counter, package_count, display_name);
timing.push_back(-1);
@@ -97,10 +97,10 @@ namespace vcpkg::Commands::CI
}
catch (const std::exception& e)
{
- System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec.display_name(), e.what());
+ System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec, e.what());
results.back() = BuildResult::NULLVALUE;
}
- System::println("Elapsed time for package %s: %s", action.spec.display_name(), build_timer.to_string());
+ System::println("Elapsed time for package %s: %s", action.spec, build_timer.to_string());
}
System::println("Total time taken: %s", timer.to_string());

MODIFY
src/commands_install.cpp
src/commands_install.cpp
@@ -201,7 +201,7 @@ namespace vcpkg::Commands::Install
const fs::path triplet_install_path = paths.installed / triplet.canonical_name();
System::println(System::Color::error, "The following files are already installed in %s and are in conflict with %s",
triplet_install_path.generic_string(),
- binary_paragraph.spec.display_name());
+ binary_paragraph.spec);
System::print("\n ");
System::println(Strings::join("\n ", intersection));
System::println("");
@@ -281,7 +281,7 @@ namespace vcpkg::Commands::Install
// execute the plan
for (const PackageSpecWithInstallPlan& action : install_plan)
{
- const std::string display_name = action.spec.display_name();
+ const std::string display_name = action.spec.to_string();
try
{
@@ -324,7 +324,7 @@ namespace vcpkg::Commands::Install
}
catch (const std::exception& e)
{
- System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec.display_name(), e.what());
+ System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec, e.what());
Checks::exit_fail(VCPKG_LINE_INFO);
}
}

MODIFY
src/commands_remove.cpp
src/commands_remove.cpp
@@ -200,7 +200,7 @@ namespace vcpkg::Commands::Remove
for (const PackageSpecWithRemovePlan& action : remove_plan)
{
- const std::string display_name = action.spec.display_name();
+ const std::string display_name = action.spec.to_string();
switch (action.plan.plan_type)
{

MODIFY
src/commands_update.cpp
src/commands_update.cpp
@@ -56,7 +56,7 @@ namespace vcpkg::Commands::Update
System::println("The following packages differ from their port versions:");
for (auto&& package : outdated_packages)
{
- System::println(" %-32s %s", package.spec.display_name(), package.version_diff.to_string());
+ System::println(" %-32s %s", package.spec, package.version_diff.to_string());
}
System::println("\n"
"To update these packages, run\n"

Remove PackageSpec.display_name()