diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 16:01:09 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 16:22:34 -0700 |
| commit | e56d87c689ba4d8ac22b0b5840486790891e838c (patch) | |
| tree | ef03203271d0e0b467d615f02b8242255006b969 /toolsrc/src | |
| parent | 19123677d111143dcbe0b168f4af90771be302cb (diff) | |
| download | vcpkg-e56d87c689ba4d8ac22b0b5840486790891e838c.tar.gz vcpkg-e56d87c689ba4d8ac22b0b5840486790891e838c.zip | |
Remove to_printf_args(PackageSpec)
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/PackageSpec.cpp | 5 | ||||
| -rw-r--r-- | toolsrc/src/commands_build.cpp | 2 | ||||
| -rw-r--r-- | toolsrc/src/commands_ci.cpp | 13 | ||||
| -rw-r--r-- | toolsrc/src/commands_install.cpp | 20 |
4 files changed, 19 insertions, 21 deletions
diff --git a/toolsrc/src/PackageSpec.cpp b/toolsrc/src/PackageSpec.cpp index fab0cc8b6..2eb5c1f23 100644 --- a/toolsrc/src/PackageSpec.cpp +++ b/toolsrc/src/PackageSpec.cpp @@ -65,11 +65,6 @@ namespace vcpkg return this->display_name(); } - std::string to_printf_arg(const PackageSpec& spec) - { - return spec.to_string(); - } - bool operator==(const PackageSpec& left, const PackageSpec& right) { return left.name() == right.name() && left.target_triplet() == right.target_triplet(); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index 9bf7eabcd..1794c8f79 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/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, maybe_spgh.error_code().message()); + 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()); const SourceParagraph& spgh = *maybe_spgh.get(); StatusParagraphs status_db = database_load_check(paths); diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 72137f8bb..8972aa339 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -48,7 +48,8 @@ namespace vcpkg::Commands::CI { const ElapsedTime build_timer = ElapsedTime::create_started(); counter++; - System::println("Starting package %d/%d: %s", counter, package_count, action.spec.to_string()); + const std::string display_name = action.spec.display_name(); + System::println("Starting package %d/%d: %s", counter, package_count, display_name); timing.push_back(-1); results.push_back(BuildResult::NULLVALUE); @@ -58,7 +59,7 @@ namespace vcpkg::Commands::CI if (action.plan.plan_type == InstallPlanType::ALREADY_INSTALLED) { results.back() = BuildResult::SUCCEEDED; - System::println(System::Color::success, "Package %s is already installed", action.spec); + System::println(System::Color::success, "Package %s is already installed", display_name); } else if (action.plan.plan_type == InstallPlanType::BUILD_AND_INSTALL) { @@ -76,23 +77,23 @@ namespace vcpkg::Commands::CI } const BinaryParagraph bpgh = Paragraphs::try_load_cached_package(paths, action.spec).value_or_exit(VCPKG_LINE_INFO); Install::install_package(paths, bpgh, &status_db); - System::println(System::Color::success, "Package %s is installed", action.spec); + System::println(System::Color::success, "Package %s is installed", display_name); } else if (action.plan.plan_type == InstallPlanType::INSTALL) { results.back() = BuildResult::SUCCEEDED; Install::install_package(paths, action.plan.binary_pgh.value_or_exit(VCPKG_LINE_INFO), &status_db); - System::println(System::Color::success, "Package %s is installed from cache", action.spec); + System::println(System::Color::success, "Package %s is installed from cache", display_name); } else Checks::unreachable(VCPKG_LINE_INFO); } catch (const std::exception& e) { - System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec, e.what()); + System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec.display_name(), e.what()); results.back() = BuildResult::NULLVALUE; } - System::println("Elapsed time for package %s: %s", action.spec, build_timer.to_string()); + System::println("Elapsed time for package %s: %s", action.spec.display_name(), build_timer.to_string()); } System::println("Total time taken: %s", timer.to_string()); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 2c57404de..1a8fccf9e 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/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); + binary_paragraph.spec.display_name()); System::print("\n "); System::println(Strings::join("\n ", intersection)); System::println(""); @@ -281,16 +281,18 @@ namespace vcpkg::Commands::Install // execute the plan for (const PackageSpecWithInstallPlan& action : install_plan) { + const std::string display_name = action.spec.display_name(); + try { switch (action.plan.plan_type) { case InstallPlanType::ALREADY_INSTALLED: - System::println(System::Color::success, "Package %s is already installed", action.spec); + System::println(System::Color::success, "Package %s is already installed", action.spec.display_name()); break; case InstallPlanType::BUILD_AND_INSTALL: { - System::println("Building package %s... ", action.spec); + System::println("Building package %s... ", display_name); const Build::BuildResult result = Commands::Build::build_package(action.plan.source_pgh.value_or_exit(VCPKG_LINE_INFO), action.spec, paths, @@ -302,18 +304,18 @@ namespace vcpkg::Commands::Install System::println(Build::create_user_troubleshooting_message(action.spec)); Checks::exit_fail(VCPKG_LINE_INFO); } - System::println(System::Color::success, "Building package %s... done", action.spec); + System::println(System::Color::success, "Building package %s... done", display_name); const BinaryParagraph bpgh = Paragraphs::try_load_cached_package(paths, action.spec).value_or_exit(VCPKG_LINE_INFO); - System::println("Installing package %s... ", action.spec); + System::println("Installing package %s... ", display_name); install_package(paths, bpgh, &status_db); - System::println(System::Color::success, "Installing package %s... done", action.spec); + System::println(System::Color::success, "Installing package %s... done", display_name); break; } case InstallPlanType::INSTALL: - System::println("Installing package %s... ", action.spec); + System::println("Installing package %s... ", display_name); install_package(paths, action.plan.binary_pgh.value_or_exit(VCPKG_LINE_INFO), &status_db); - System::println(System::Color::success, "Installing package %s... done", action.spec); + System::println(System::Color::success, "Installing package %s... done", display_name); break; case InstallPlanType::UNKNOWN: default: @@ -322,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, e.what()); + System::println(System::Color::error, "Error: Could not install package %s: %s", action.spec.display_name(), e.what()); Checks::exit_fail(VCPKG_LINE_INFO); } } |
