aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_install.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/commands_install.cpp')
-rw-r--r--toolsrc/src/commands_install.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp
index 1f5a2234d..4ae311f83 100644
--- a/toolsrc/src/commands_install.cpp
+++ b/toolsrc/src/commands_install.cpp
@@ -24,7 +24,7 @@ namespace vcpkg::Commands::Install
const std::string& target_triplet_as_string = target_triplet.canonical_name();
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));
+ output.push_back(Strings::format(R"(%s/)", target_triplet_as_string));
for (auto it = fs::recursive_directory_iterator(package_prefix_path); it != fs::recursive_directory_iterator(); ++it)
{
@@ -54,7 +54,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/)", target_triplet_as_string, suffix));
continue;
}
@@ -82,6 +82,8 @@ namespace vcpkg::Commands::Install
System::println(System::color::error, "failed: %s: cannot handle file type", it->path().u8string());
}
+ std::sort(output.begin(), output.end());
+
Files::write_all_lines(paths.listfile_path(bpgh), output);
}
@@ -185,10 +187,11 @@ namespace vcpkg::Commands::Install
{
static const std::string example = Commands::Help::create_example_string("install zlib zlib:x64-windows curl boost");
args.check_min_arg_count(1, example);
- StatusParagraphs status_db = database_load_check(paths);
-
std::vector<package_spec> specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example);
Input::check_triplets(specs, paths);
+ args.check_and_get_optional_command_arguments({});
+
+ StatusParagraphs status_db = database_load_check(paths);
std::vector<package_spec_with_install_plan> install_plan = Dependencies::create_install_plan(paths, specs, status_db);
Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty");
@@ -214,7 +217,13 @@ namespace vcpkg::Commands::Install
}
else if (action.plan.plan_type == install_plan_type::BUILD_AND_INSTALL)
{
- Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec));
+ const Build::BuildResult result = Commands::Build::build_package(*action.plan.source_pgh, action.spec, paths, paths.port_dir(action.spec), status_db);
+ if (result != Build::BuildResult::SUCCEEDED)
+ {
+ System::println(System::color::error, Build::create_error_message(result, action.spec));
+ System::println(Build::create_user_troubleshooting_message(action.spec));
+ exit(EXIT_FAILURE);
+ }
const BinaryParagraph bpgh = try_load_cached_package(paths, action.spec).get_or_throw();
install_package(paths, bpgh, &status_db);
System::println(System::color::success, "Package %s is installed", action.spec);