diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 7c39eeaa4e..110f74b518 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -7,7 +7,7 @@ namespace vcpkg { struct PackageSpec { - static Expected from_string(const std::string& spec_as_string, const Triplet& default_target_triplet); + static Expected from_string(const std::string& spec_as_string, const Triplet& default_triplet); static Expected from_name_and_triplet(const std::string& name, const Triplet& target_triplet); diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index db15a10fd2..cc6437bf9d 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -8,7 +8,7 @@ namespace vcpkg::Commands { - using CommandTypeA = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + using CommandTypeA = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); using CommandTypeB = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); using CommandTypeC = void(*)(const VcpkgCmdArguments& args); @@ -33,28 +33,28 @@ namespace vcpkg::Commands BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const VcpkgPaths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set& options, const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } namespace BuildExternal { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } namespace Install { void install_package(const VcpkgPaths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } namespace CI { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } namespace Remove { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } namespace Update diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index fd549f2789..97fb09e3d0 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -7,7 +7,7 @@ namespace vcpkg::Input { PackageSpec check_and_get_package_spec( const std::string& package_spec_as_string, - const Triplet& default_target_triplet, + const Triplet& default_triplet, CStringView example_text); void check_triplet(const Triplet& t, const VcpkgPaths& paths); diff --git a/toolsrc/src/PackageSpec.cpp b/toolsrc/src/PackageSpec.cpp index a1b129b5cc..c1ef9c56bf 100644 --- a/toolsrc/src/PackageSpec.cpp +++ b/toolsrc/src/PackageSpec.cpp @@ -8,12 +8,12 @@ namespace vcpkg return (c == '-') || isdigit(c) || (isalpha(c) && islower(c)); } - Expected PackageSpec::from_string(const std::string& spec_as_string, const Triplet& default_target_triplet) + Expected PackageSpec::from_string(const std::string& spec_as_string, const Triplet& default_triplet) { auto pos = spec_as_string.find(':'); if (pos == std::string::npos) { - return from_name_and_triplet(spec_as_string, default_target_triplet); + return from_name_and_triplet(spec_as_string, default_triplet); } auto pos2 = spec_as_string.find(':', pos + 1); diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp index c74e026ffb..f8e346938d 100644 --- a/toolsrc/src/commands_build.cpp +++ b/toolsrc/src/commands_build.cpp @@ -178,11 +178,11 @@ namespace vcpkg::Commands::Build Checks::exit_success(VCPKG_LINE_INFO); } - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet) + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows"); args.check_exact_arg_count(1, example); // Build only takes a single package and all dependencies must already be installed - const PackageSpec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); + const PackageSpec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_triplet, example); Input::check_triplet(spec.target_triplet(), paths); const std::unordered_set options = args.check_and_get_optional_command_arguments({ OPTION_CHECKS_ONLY }); perform_and_exit(spec, paths.port_dir(spec), options, paths); diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/commands_build_external.cpp index 7b5a010256..ff0ae074cb 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/commands_build_external.cpp @@ -5,11 +5,11 @@ namespace vcpkg::Commands::BuildExternal { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet) + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, example); - const PackageSpec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example); + const PackageSpec spec = Input::check_and_get_package_spec(args.command_arguments.at(0), default_triplet, example); Input::check_triplet(spec.target_triplet(), paths); const std::unordered_set options = args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/commands_ci.cpp index 5071effde7..3f341580e0 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/commands_ci.cpp @@ -26,11 +26,11 @@ namespace vcpkg::Commands::CI return specs; } - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet) + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { static const std::string example = Commands::Help::create_example_string("ci x64-windows"); args.check_max_arg_count(1, example); - const Triplet target_triplet = args.command_arguments.size() == 1 ? Triplet::from_canonical_name(args.command_arguments.at(0)) : default_target_triplet; + const Triplet target_triplet = args.command_arguments.size() == 1 ? Triplet::from_canonical_name(args.command_arguments.at(0)) : default_triplet; Input::check_triplet(target_triplet, paths); args.check_and_get_optional_command_arguments({}); const std::vector specs = load_all_package_specs(paths.ports, target_triplet); diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp index f741d86086..232c9af9f9 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/commands_install.cpp @@ -230,7 +230,7 @@ namespace vcpkg::Commands::Install status_db->insert(std::make_unique(spgh)); } - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet) + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { static const std::string OPTION_DRY_RUN = "--dry-run"; @@ -240,7 +240,7 @@ namespace vcpkg::Commands::Install const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { - return Input::check_and_get_package_spec(arg, default_target_triplet, example); + return Input::check_and_get_package_spec(arg, default_triplet, example); }); for (auto&& spec : specs) Input::check_triplet(spec.target_triplet(), paths); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7899980e5d..7f616dd955 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -136,7 +136,7 @@ namespace vcpkg::Commands::Remove } } - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet) + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { static const std::string OPTION_PURGE = "--purge"; static const std::string OPTION_NO_PURGE = "--no-purge"; @@ -156,7 +156,7 @@ namespace vcpkg::Commands::Remove else { args.check_min_arg_count(1, example); - specs = Util::fmap(args.command_arguments, [&](auto&& arg) { return Input::check_and_get_package_spec(arg, default_target_triplet, example); }); + specs = Util::fmap(args.command_arguments, [&](auto&& arg) { return Input::check_and_get_package_spec(arg, default_triplet, example); }); for (auto&& spec : specs) Input::check_triplet(spec.target_triplet(), paths); } diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index aa19df6164..ffe325f6ee 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -69,29 +69,29 @@ static void inner(const VcpkgCmdArguments& args) return command_function(args, paths); } - Triplet default_target_triplet; + Triplet default_triplet; if (args.target_triplet != nullptr) { - default_target_triplet = Triplet::from_canonical_name(*args.target_triplet); + default_triplet = Triplet::from_canonical_name(*args.target_triplet); } else { const Optional vcpkg_default_triplet_env = System::get_environmental_variable(L"VCPKG_DEFAULT_TRIPLET"); if (auto v = vcpkg_default_triplet_env.get()) { - default_target_triplet = Triplet::from_canonical_name(Strings::utf16_to_utf8(*v)); + default_triplet = Triplet::from_canonical_name(Strings::utf16_to_utf8(*v)); } else { - default_target_triplet = Triplet::X86_WINDOWS; + default_triplet = Triplet::X86_WINDOWS; } } - Input::check_triplet(default_target_triplet, paths); + Input::check_triplet(default_triplet, paths); if (auto command_function = Commands::find(args.command, Commands::get_available_commands_type_a())) { - return command_function(args, paths, default_target_triplet); + return command_function(args, paths, default_triplet); } return invalid_command(args.command); diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp index 5cd889453d..1e74f2e90e 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg_Input.cpp @@ -6,10 +6,10 @@ namespace vcpkg::Input { - PackageSpec check_and_get_package_spec(const std::string& package_spec_as_string, const Triplet& default_target_triplet, CStringView example_text) + PackageSpec check_and_get_package_spec(const std::string& package_spec_as_string, const Triplet& default_triplet, CStringView example_text) { const std::string as_lowercase = Strings::ascii_to_lowercase(package_spec_as_string); - Expected expected_spec = PackageSpec::from_string(as_lowercase, default_target_triplet); + Expected expected_spec = PackageSpec::from_string(as_lowercase, default_triplet); if (auto spec = expected_spec.get()) { return *spec;