diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-05-04 18:14:54 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-05-04 18:14:54 -0700 |
| commit | ab58f531ccf6da9895502cb8ae7bd85b29823d1d (patch) | |
| tree | 30e3857f01d9323d72be556686bd3bbe77a44299 | |
| parent | 9265fe76bf3ed53db03eb31cad9be1c7594bfcb3 (diff) | |
| download | vcpkg-ab58f531ccf6da9895502cb8ae7bd85b29823d1d.tar.gz vcpkg-ab58f531ccf6da9895502cb8ae7bd85b29823d1d.zip | |
git for linux/osx version moved to vcpkgTools.xml
| -rw-r--r-- | scripts/vcpkgTools.xml | 12 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg/commands.fetch.cpp | 18 |
2 files changed, 22 insertions, 8 deletions
diff --git a/scripts/vcpkgTools.xml b/scripts/vcpkgTools.xml index 1a2abae81..1f17102d2 100644 --- a/scripts/vcpkgTools.xml +++ b/scripts/vcpkgTools.xml @@ -28,6 +28,18 @@ <sha512>a34575ab1b4f553e62535e38492904b512df4d6a837cf4abf205dbcdd05edf1eef450cc5b15a4f63f901424d5f3cd1f78b6b22437d0d4f8cd9ce4e42e82617b9</sha512> <archiveName>MinGit-2.17.0-32-bit.zip</archiveName> </tool> + <tool name="git" os="linux"> + <version>2.7.4</version> + <exeRelativePath></exeRelativePath> + <url></url> + <sha512></sha512> + </tool> + <tool name="git" os="osx"> + <version>2.7.4</version> + <exeRelativePath></exeRelativePath> + <url></url> + <sha512></sha512> + </tool> <tool name="vswhere" os="windows"> <version>2.4.1</version> <exeRelativePath>vswhere.exe</exeRelativePath> 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"###(<tools[\s]+version="([^"]+)">)###"}; @@ -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<int, 3>& 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<fs::path> candidate_paths; |
