From 898edccbdcec9345c549945187195b75a9f49212 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 3 Apr 2017 16:30:11 -0700 Subject: [PATCH] exit_code_and_output -> ExitCodeAndOutput --- toolsrc/include/vcpkg_System.h | 4 ++-- toolsrc/src/PostBuildLint.cpp | 8 ++++---- toolsrc/src/VcpkgPaths.cpp | 4 ++-- toolsrc/src/commands_portsdiff.cpp | 2 +- toolsrc/src/vcpkg_System.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index e4f93ad8f..d1069464b 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -9,7 +9,7 @@ namespace vcpkg::System { fs::path get_exe_path_of_current_process(); - struct exit_code_and_output + struct ExitCodeAndOutput { int exit_code; std::string output; @@ -19,7 +19,7 @@ namespace vcpkg::System int cmd_execute(const CWStringView cmd_line); - exit_code_and_output cmd_execute_and_capture_output(const CWStringView cmd_line); + ExitCodeAndOutput cmd_execute_and_capture_output(const CWStringView cmd_line); std::wstring create_powershell_script_cmd(const fs::path& script_path, const CWStringView args = L""); diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 30b262da9..69af21f82 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -244,7 +244,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { const std::wstring cmd_line = Strings::wformat(LR"("%s" /exports "%s")", dumpbin_exe.native(), dll.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); if (ec_data.output.find("ordinal hint RVA name") == std::string::npos) @@ -275,7 +275,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { const std::wstring cmd_line = Strings::wformat(LR"("%s" /headers "%s")", dumpbin_exe.native(), dll.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); if (ec_data.output.find("App Container") == std::string::npos) @@ -513,7 +513,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& lib : libs) { const std::wstring cmd_line = Strings::wformat(LR"("%s" /directives "%s")", dumpbin_exe.native(), lib.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); for (const BuildType::Type& bad_build_type : bad_build_types) @@ -560,7 +560,7 @@ namespace vcpkg::PostBuildLint for (const fs::path& dll : dlls) { const std::wstring cmd_line = Strings::wformat(LR"("%s" /dependents "%s")", dumpbin_exe.native(), dll.native()); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd_line); + System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd_line); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", Strings::utf16_to_utf8(cmd_line)); for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) diff --git a/toolsrc/src/VcpkgPaths.cpp b/toolsrc/src/VcpkgPaths.cpp index 93a181ef5..e4a9de4b1 100644 --- a/toolsrc/src/VcpkgPaths.cpp +++ b/toolsrc/src/VcpkgPaths.cpp @@ -70,7 +70,7 @@ namespace vcpkg { const fs::path script = scripts_folder / "fetchDependency.ps1"; auto install_cmd = System::create_powershell_script_cmd(script, Strings::wformat(L"-Dependency %s", tool_name)); - System::exit_code_and_output rc = System::cmd_execute_and_capture_output(install_cmd); + System::ExitCodeAndOutput rc = System::cmd_execute_and_capture_output(install_cmd); if (rc.exit_code) { System::println(System::color::error, "Launching powershell failed or was denied"); @@ -245,7 +245,7 @@ namespace vcpkg { const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1"; const std::wstring cmd = System::create_powershell_script_cmd(script); - System::exit_code_and_output ec_data = System::cmd_execute_and_capture_output(cmd); + System::ExitCodeAndOutput ec_data = System::cmd_execute_and_capture_output(cmd); Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Could not run script to detect VS 2017 instances"); return Strings::split(ec_data.output, "\n"); } diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 249d48616..22c7ecfda 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -96,7 +96,7 @@ namespace vcpkg::Commands::PortsDiff static const std::string VALID_COMMIT_OUTPUT = "commit\n"; const std::wstring cmd = Strings::wformat(LR"("%s" cat-file -t %s)", git_exe.native(), git_commit_id); - const System::exit_code_and_output output = System::cmd_execute_and_capture_output(cmd); + const System::ExitCodeAndOutput output = System::cmd_execute_and_capture_output(cmd); Checks::check_exit(VCPKG_LINE_INFO, output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id)); } diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp index b4cf0b40d..d6ef76bd3 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg_System.cpp @@ -99,7 +99,7 @@ namespace vcpkg::System return exit_code; } - exit_code_and_output cmd_execute_and_capture_output(const CWStringView cmd_line) + ExitCodeAndOutput cmd_execute_and_capture_output(const CWStringView cmd_line) { // Flush stdout before launching external process fflush(stdout);