diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 17:53:57 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 17:53:57 -0700 |
| commit | 12f09d3151b44571ce64217ca4f6c5958d249cd6 (patch) | |
| tree | 2fedcdabec3e587bcb5dca37a1efaf52df08a598 /toolsrc/src | |
| parent | 2069028b06181dab3c51b2dceb170594153c1204 (diff) | |
| download | vcpkg-12f09d3151b44571ce64217ca4f6c5958d249cd6.tar.gz vcpkg-12f09d3151b44571ce64217ca4f6c5958d249cd6.zip | |
Use Triplet.canonical_name() or .to_string()
Diffstat (limited to 'toolsrc/src')
| -rw-r--r-- | toolsrc/src/commands_install.cpp | 13 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg_Input.cpp | 4 |
2 files changed, 9 insertions, 8 deletions
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index 38672da3a..3b476add3 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -23,10 +23,11 @@ namespace vcpkg::Commands::Install const size_t prefix_length = package_prefix_path.native().size(); const Triplet& target_triplet = bpgh.spec.target_triplet(); - const std::string& target_triplet_as_string = target_triplet.canonical_name(); + const std::string& triplet_subfolder = target_triplet.canonical_name(); + const fs::path triplet_subfolder_path = paths.installed / triplet_subfolder; std::error_code ec; - fs::create_directory(paths.installed / target_triplet_as_string, ec); - output.push_back(Strings::format(R"(%s/)", target_triplet_as_string)); + fs::create_directory(triplet_subfolder_path, ec); + output.push_back(Strings::format(R"(%s/)", triplet_subfolder)); for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it) { @@ -38,7 +39,7 @@ namespace vcpkg::Commands::Install } const std::string suffix = it->path().generic_u8string().substr(prefix_length + 1); - const fs::path target = paths.installed / target_triplet_as_string / suffix; + const fs::path target = triplet_subfolder_path / suffix; auto status = it->status(ec); if (ec) @@ -56,7 +57,7 @@ namespace vcpkg::Commands::Install } // Trailing backslash for directories - output.push_back(Strings::format(R"(%s/%s/)", target_triplet_as_string, suffix)); + output.push_back(Strings::format(R"(%s/%s/)", triplet_subfolder, suffix)); continue; } @@ -71,7 +72,7 @@ namespace vcpkg::Commands::Install { System::println(System::Color::error, "failed: %s: %s", target.u8string(), ec.message()); } - output.push_back(Strings::format(R"(%s/%s)", target_triplet_as_string, suffix)); + output.push_back(Strings::format(R"(%s/%s)", triplet_subfolder, suffix)); continue; } diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index d66065cc2..5cd889453 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -25,8 +25,8 @@ namespace vcpkg::Input { if (!paths.is_valid_triplet(t)) { - System::println(System::Color::error, "Error: invalid triplet: %s", t.canonical_name()); - Metrics::track_property("error", "invalid triplet: " + t.canonical_name()); + System::println(System::Color::error, "Error: invalid triplet: %s", t); + Metrics::track_property("error", "invalid triplet: " + t.to_string()); Commands::Help::help_topic_valid_triplet(paths); Checks::exit_fail(VCPKG_LINE_INFO); } |
