aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-08-15 13:56:20 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-08-15 13:56:20 -0700
commit28ae8e94d5ba7c285dde6b8820b3bd56f5f775f7 (patch)
treea7952616386d4fa19ee9f44aff204e27de85f249 /toolsrc/src
parent957cb214e92f45069f142d8b6ccf2a6425df9c51 (diff)
parentcd7f4cccffd915edc2d4b625ff32dea970ec073f (diff)
downloadvcpkg-28ae8e94d5ba7c285dde6b8820b3bd56f5f775f7.tar.gz
vcpkg-28ae8e94d5ba7c285dde6b8820b3bd56f5f775f7.zip
Merge branch 'master' into qualifier_change
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/BinaryParagraph.cpp4
-rw-r--r--toolsrc/src/SourceParagraph.cpp4
-rw-r--r--toolsrc/src/VcpkgPaths.cpp37
-rw-r--r--toolsrc/src/commands_depends.cpp34
4 files changed, 58 insertions, 21 deletions
diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/BinaryParagraph.cpp
index b6f3e8a87..49e9d58e5 100644
--- a/toolsrc/src/BinaryParagraph.cpp
+++ b/toolsrc/src/BinaryParagraph.cpp
@@ -56,8 +56,10 @@ namespace vcpkg
this->default_features = parse_comma_list(parser.optional_field(Fields::DEFAULTFEATURES));
}
- if (auto err = parser.error_info(this->spec.name()))
+ if (auto err = parser.error_info(this->spec.to_string()))
{
+ System::println(
+ System::Color::error, "Error: while parsing the Binary Paragraph for %s", this->spec.to_string());
print_error_message(err);
Checks::exit_fail(VCPKG_LINE_INFO);
}
diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/SourceParagraph.cpp
index cb7aeb33e..a37567f3a 100644
--- a/toolsrc/src/SourceParagraph.cpp
+++ b/toolsrc/src/SourceParagraph.cpp
@@ -54,7 +54,7 @@ namespace vcpkg
if (!error_info->extra_fields.empty())
{
System::println(System::Color::error,
- "Error: There are invalid fields in the Source Paragraph of %s",
+ "Error: There are invalid fields in the control file of %s",
error_info->name);
System::println("The following fields were not expected:\n\n %s\n",
Strings::join("\n ", error_info->extra_fields));
@@ -74,7 +74,7 @@ namespace vcpkg
if (!error_info->missing_fields.empty())
{
System::println(System::Color::error,
- "Error: There are missing fields in the Source Paragraphs of %s",
+ "Error: There are missing fields in the control file of %s",
error_info->name);
System::println("The following fields were missing:\n\n %s\n",
Strings::join("\n ", error_info->missing_fields));
diff --git a/toolsrc/src/VcpkgPaths.cpp b/toolsrc/src/VcpkgPaths.cpp
index bc1152b9d..60204bcdd 100644
--- a/toolsrc/src/VcpkgPaths.cpp
+++ b/toolsrc/src/VcpkgPaths.cpp
@@ -70,16 +70,23 @@ namespace vcpkg
return Util::fmap(Strings::split(out.output, "\n"), [](auto&& s) { return fs::path(s); });
}
- static fs::path fetch_dependency(const fs::path scripts_folder,
+ static fs::path fetch_dependency(const fs::path& scripts_folder,
const std::wstring& tool_name,
- const fs::path& expected_downloaded_path)
+ const fs::path& expected_downloaded_path,
+ const std::array<int, 3>& version)
{
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::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");
+ const std::string version_as_string = Strings::format("%d.%d.%d", version[0], version[1], version[2]);
+
+ System::println(System::Color::error,
+ "Launching powershell failed or was denied when trying to fetch %s version %s.\n"
+ "(No sufficient installed version was found)",
+ Strings::to_utf8(tool_name),
+ version_as_string);
Metrics::track_property("error", "powershell install failed");
Metrics::track_property("installcmd", install_cmd);
Checks::exit_with_code(VCPKG_LINE_INFO, rc.exit_code);
@@ -96,12 +103,12 @@ namespace vcpkg
return actual_downloaded_path;
}
- static fs::path get_cmake_path(const fs::path& downloads_folder, const fs::path scripts_folder)
+ static fs::path get_cmake_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
{
- static constexpr std::array<int, 3> expected_version = {3, 9, 0};
+ static constexpr std::array<int, 3> expected_version = {3, 9, 1};
static const std::wstring version_check_arguments = L"--version";
- const fs::path downloaded_copy = downloads_folder / "cmake-3.9.0-win32-x86" / "bin" / "cmake.exe";
+ const fs::path downloaded_copy = downloads_folder / "cmake-3.9.1-win32-x86" / "bin" / "cmake.exe";
const std::vector<fs::path> from_path = find_from_PATH(L"cmake");
std::vector<fs::path> candidate_paths;
@@ -117,15 +124,15 @@ namespace vcpkg
return *p;
}
- return fetch_dependency(scripts_folder, L"cmake", downloaded_copy);
+ return fetch_dependency(scripts_folder, L"cmake", downloaded_copy, expected_version);
}
- fs::path get_nuget_path(const fs::path& downloads_folder, const fs::path scripts_folder)
+ fs::path get_nuget_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
{
- static constexpr std::array<int, 3> expected_version = {3, 3, 0};
+ static constexpr std::array<int, 3> expected_version = {4, 1, 0};
static const std::wstring version_check_arguments = L"";
- const fs::path downloaded_copy = downloads_folder / "nuget-3.5.0" / "nuget.exe";
+ const fs::path downloaded_copy = downloads_folder / "nuget-4.1.0" / "nuget.exe";
const std::vector<fs::path> from_path = find_from_PATH(L"nuget");
std::vector<fs::path> candidate_paths;
@@ -138,15 +145,15 @@ namespace vcpkg
return *p;
}
- return fetch_dependency(scripts_folder, L"nuget", downloaded_copy);
+ return fetch_dependency(scripts_folder, L"nuget", downloaded_copy, expected_version);
}
- fs::path get_git_path(const fs::path& downloads_folder, const fs::path scripts_folder)
+ fs::path get_git_path(const fs::path& downloads_folder, const fs::path& scripts_folder)
{
- static constexpr std::array<int, 3> expected_version = {2, 0, 0};
+ static constexpr std::array<int, 3> expected_version = {2, 14, 1};
static const std::wstring version_check_arguments = L"--version";
- const fs::path downloaded_copy = downloads_folder / "MinGit-2.11.1-32-bit" / "cmd" / "git.exe";
+ const fs::path downloaded_copy = downloads_folder / "MinGit-2.14.1-32-bit" / "cmd" / "git.exe";
const std::vector<fs::path> from_path = find_from_PATH(L"git");
std::vector<fs::path> candidate_paths;
@@ -162,7 +169,7 @@ namespace vcpkg
return *p;
}
- return fetch_dependency(scripts_folder, L"git", downloaded_copy);
+ return fetch_dependency(scripts_folder, L"git", downloaded_copy, expected_version);
}
Expected<VcpkgPaths> VcpkgPaths::create(const fs::path& vcpkg_root_dir)
diff --git a/toolsrc/src/commands_depends.cpp b/toolsrc/src/commands_depends.cpp
index ccfe58e4e..2d1fb658b 100644
--- a/toolsrc/src/commands_depends.cpp
+++ b/toolsrc/src/commands_depends.cpp
@@ -4,16 +4,44 @@
#include "vcpkg_Commands.h"
#include "vcpkg_Strings.h"
#include "vcpkg_System.h"
+#include "vcpkg_Util.h"
namespace vcpkg::Commands::DependInfo
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
{
- static const std::string example = Commands::Help::create_example_string(R"###(depend-info)###");
- args.check_exact_arg_count(0, example);
+ static const std::string example = Commands::Help::create_example_string(R"###(depend-info [pat])###");
+ args.check_max_arg_count(1, example);
args.check_and_get_optional_command_arguments({});
- const auto source_control_files = Paragraphs::load_all_ports(paths.get_filesystem(), paths.ports);
+ std::vector<std::unique_ptr<SourceControlFile>> source_control_files =
+ Paragraphs::load_all_ports(paths.get_filesystem(), paths.ports);
+
+ if (args.command_arguments.size() == 1)
+ {
+ const std::string filter = args.command_arguments.at(0);
+
+ Util::erase_remove_if(source_control_files,
+ [&](const std::unique_ptr<SourceControlFile>& source_control_file) {
+
+ const SourceParagraph& source_paragraph = *source_control_file->core_paragraph;
+
+ if (Strings::case_insensitive_ascii_contains(source_paragraph.name, filter))
+ {
+ return false;
+ }
+
+ for (const Dependency& dependency : source_paragraph.depends)
+ {
+ if (Strings::case_insensitive_ascii_contains(dependency.name, filter))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ });
+ }
for (auto&& source_control_file : source_control_files)
{