From ab58f531ccf6da9895502cb8ae7bd85b29823d1d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 4 May 2018 18:14:54 -0700 Subject: git for linux/osx version moved to vcpkgTools.xml --- toolsrc/src/vcpkg/commands.fetch.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'toolsrc/src') diff --git a/toolsrc/src/vcpkg/commands.fetch.cpp b/toolsrc/src/vcpkg/commands.fetch.cpp index 1e31e6bc4..a6cfec3f0 100644 --- a/toolsrc/src/vcpkg/commands.fetch.cpp +++ b/toolsrc/src/vcpkg/commands.fetch.cpp @@ -83,7 +83,8 @@ namespace vcpkg::Commands::Fetch right_delim, XML_PATH.generic_string()); - return *result.get(); + auto r = *result.get(); + return Strings::trim(std::move(r)); }; static const std::regex XML_VERSION_REGEX{R"###()###"}; @@ -255,8 +256,8 @@ namespace vcpkg::Commands::Fetch const std::string download_path_part = download_path.u8string() + ".part"; std::error_code ec; fs.remove(download_path_part, ec); - const auto code = System::cmd_execute(Strings::format( - R"(curl -L '%s' --create-dirs --output '%s')", url, download_path_part)); + const auto code = System::cmd_execute( + Strings::format(R"(curl -L '%s' --create-dirs --output '%s')", url, download_path_part)); Checks::check_exit(VCPKG_LINE_INFO, code == 0, "Could not download %s", url); verify_hash(paths, url, download_path_part, sha512); @@ -267,8 +268,13 @@ namespace vcpkg::Commands::Fetch static fs::path fetch_tool(const VcpkgPaths& paths, const std::string& tool_name, const ToolData& tool_data) { const std::array& version = tool_data.version; - const std::string version_as_string = Strings::format("%d.%d.%d", version[0], version[1], version[2]); + Checks::check_exit(VCPKG_LINE_INFO, + !tool_data.url.empty(), + "A suitable version of %s was not found (required v%s) and unable to automatically " + "download a portable one. Please install a newer version of git.", + tool_name, + version_as_string); System::println("A suitable version of %s was not found (required v%s). Downloading portable %s v%s...", tool_name, version_as_string, @@ -401,11 +407,7 @@ namespace vcpkg::Commands::Fetch static fs::path get_git_path(const VcpkgPaths& paths) { -#if defined(_WIN32) static const ToolData TOOL_DATA = parse_tool_data_from_xml(paths, "git"); -#else - static const ToolData TOOL_DATA = ToolData{{2, 7, 4}, ""}; -#endif static const std::string VERSION_CHECK_ARGUMENTS = "--version"; std::vector candidate_paths; -- cgit v1.2.3