diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-17 15:42:20 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-11-17 15:42:20 -0800 |
| commit | c82847682397ed084aec0a69074a3985f7fb18f9 (patch) | |
| tree | cbfd9de3613ecf16ee406ea7f42a0192be3a7f8c /toolsrc/src/commands_installation.cpp | |
| parent | 6c2ce4981f7e463c8187aa62c461da564977cea3 (diff) | |
| download | vcpkg-c82847682397ed084aec0a69074a3985f7fb18f9.tar.gz vcpkg-c82847682397ed084aec0a69074a3985f7fb18f9.zip | |
Add (undocumented) --checks-only option to the build command
Diffstat (limited to 'toolsrc/src/commands_installation.cpp')
| -rw-r--r-- | toolsrc/src/commands_installation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/toolsrc/src/commands_installation.cpp b/toolsrc/src/commands_installation.cpp index 0f0cfc954..f7af2ef7c 100644 --- a/toolsrc/src/commands_installation.cpp +++ b/toolsrc/src/commands_installation.cpp @@ -13,9 +13,11 @@ namespace vcpkg { - using Dependencies::package_spec_with_install_plan; + using Dependencies::package_spec_with_install_plan; using Dependencies::install_plan_type; + static const std::string OPTION_CHECKS_ONLY = "--checks-only"; + static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const triplet& target_triplet) { const BinaryParagraph bpgh = BinaryParagraph(source_paragraph, target_triplet); @@ -129,11 +131,19 @@ namespace vcpkg // Allowing only 1 package for now. args.check_exact_arg_count(1, example.c_str()); + StatusParagraphs status_db = database_load_check(paths); const package_spec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example.c_str()); Input::check_triplet(spec.target_triplet(), paths); + const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); + if (options.find(OPTION_CHECKS_ONLY) != options.end()) + { + perform_all_checks(spec, paths); + exit(EXIT_SUCCESS); + } + // Explicitly load and use the portfile's build dependencies when resolving the build command (instead of a cached package's dependencies). const expected<SourceParagraph> maybe_spgh = try_load_port(paths, spec.name()); Checks::check_exit(!maybe_spgh.error_code(), "Could not find package named %s: %s", spec, maybe_spgh.error_code().message()); |
