[vcpkg] Rename `port_versions` to `versions`
MODIFY
include/vcpkg/vcpkgcmdarguments.h
include/vcpkg/vcpkgcmdarguments.h
@@ -134,8 +134,8 @@ namespace vcpkg
std::unique_ptr<std::string> scripts_root_dir;
constexpr static StringLiteral BUILTIN_PORTS_ROOT_DIR_ARG = "x-builtin-ports-root";
std::unique_ptr<std::string> builtin_ports_root_dir;
- constexpr static StringLiteral BUILTIN_PORT_VERSIONS_DIR_ARG = "x-builtin-port-versions-dir";
- std::unique_ptr<std::string> builtin_port_versions_dir;
+ constexpr static StringLiteral BUILTIN_REGISTRY_VERSIONS_DIR_ARG = "x-builtin-registry-versions-dir";
+ std::unique_ptr<std::string> builtin_registry_versions_dir;
constexpr static StringLiteral DEFAULT_VISUAL_STUDIO_PATH_ENV = "VCPKG_VISUAL_STUDIO_PATH";
std::unique_ptr<std::string> default_visual_studio_path;

MODIFY
include/vcpkg/vcpkgpaths.h
include/vcpkg/vcpkgpaths.h
@@ -92,7 +92,7 @@ namespace vcpkg
fs::path scripts;
fs::path prefab;
fs::path builtin_ports;
- fs::path builtin_port_versions;
+ fs::path builtin_registry_versions;
fs::path tools;
fs::path buildsystems;

MODIFY
src/vcpkg-test/arguments.cpp
src/vcpkg-test/arguments.cpp
@@ -15,7 +15,7 @@ TEST_CASE ("VcpkgCmdArguments from lowercase argument sequence", "[arguments]")
"C:\\vcpkg",
"--x-scripts-root=C:\\scripts",
"--x-builtin-ports-root=C:\\ports",
- "--x-builtin-port-versions-dir=C:\\port_versions",
+ "--x-builtin-registry-versions-dir=C:\\versions",
"--debug",
"--sendmetrics",
"--printmetrics",
@@ -28,7 +28,7 @@ TEST_CASE ("VcpkgCmdArguments from lowercase argument sequence", "[arguments]")
REQUIRE(*v.vcpkg_root_dir == "C:\\vcpkg");
REQUIRE(*v.scripts_root_dir == "C:\\scripts");
REQUIRE(*v.builtin_ports_root_dir == "C:\\ports");
- REQUIRE(*v.builtin_port_versions_dir == "C:\\port_versions");
+ REQUIRE(*v.builtin_registry_versions_dir == "C:\\versions");
REQUIRE(v.debug);
REQUIRE(*v.debug.get());
REQUIRE(v.send_metrics);
@@ -51,7 +51,7 @@ TEST_CASE ("VcpkgCmdArguments from uppercase argument sequence", "[arguments]")
"C:\\vcpkg",
"--X-SCRIPTS-ROOT=C:\\scripts",
"--X-BUILTIN-PORTS-ROOT=C:\\ports",
- "--X-BUILTIN-PORT-VERSIONS-DIR=C:\\port_versions",
+ "--X-BUILTIN-REGISTRY-VERSIONS-DIR=C:\\versions",
"--DEBUG",
"--SENDMETRICS",
"--PRINTMETRICS",
@@ -64,7 +64,7 @@ TEST_CASE ("VcpkgCmdArguments from uppercase argument sequence", "[arguments]")
REQUIRE(*v.vcpkg_root_dir == "C:\\vcpkg");
REQUIRE(*v.scripts_root_dir == "C:\\scripts");
REQUIRE(*v.builtin_ports_root_dir == "C:\\ports");
- REQUIRE(*v.builtin_port_versions_dir == "C:\\port_versions");
+ REQUIRE(*v.builtin_registry_versions_dir == "C:\\versions");
REQUIRE(v.debug);
REQUIRE(*v.debug.get());
REQUIRE(v.send_metrics);

MODIFY
src/vcpkg/commands.add-version.cpp
src/vcpkg/commands.add-version.cpp
@@ -334,7 +334,7 @@ namespace vcpkg::Commands::AddVersion
const bool verbose = Util::Sets::contains(parsed_args.switches, OPTION_VERBOSE);
auto& fs = paths.get_filesystem();
- auto baseline_path = paths.builtin_port_versions / fs::u8path("baseline.json");
+ auto baseline_path = paths.builtin_registry_versions / fs::u8path("baseline.json");
if (!fs.exists(VCPKG_LINE_INFO, baseline_path))
{
System::printf(
@@ -400,8 +400,8 @@ namespace vcpkg::Commands::AddVersion
}
const auto& git_tree = git_tree_it->second;
- auto port_versions_path =
- paths.builtin_port_versions / Strings::concat(port_name[0], '-') / Strings::concat(port_name, ".json");
+ auto port_versions_path = paths.builtin_registry_versions / fs::u8path({port_name[0], '-'}) /
+ fs::u8path(Strings::concat(port_name, ".json"));
update_version_db_file(
paths, port_name, schemed_version, git_tree, port_versions_path, overwrite_version, verbose, add_all);
update_baseline_version(paths, port_name, schemed_version.versiont, baseline_path, verbose);

MODIFY
src/vcpkg/commands.civerifyversions.cpp
src/vcpkg/commands.civerifyversions.cpp
@@ -367,8 +367,8 @@ namespace vcpkg::Commands::CIVerifyVersions
continue;
}
- auto versions_file_path =
- paths.builtin_port_versions / Strings::concat(port_name[0], '-') / Strings::concat(port_name, ".json");
+ auto versions_file_path = paths.builtin_registry_versions / fs::u8path({port_name[0], '-'}) /
+ fs::u8path(Strings::concat(port_name, ".json"));
if (!fs.exists(versions_file_path))
{
System::printf(System::Color::error, "FAIL: %s\n", port_name);

MODIFY
src/vcpkg/registries.cpp
src/vcpkg/registries.cpp
@@ -19,7 +19,7 @@ namespace
using Baseline = std::map<std::string, VersionT, std::less<>>;
- static fs::path port_versions_dir = fs::u8path("port_versions");
+ static const fs::path registry_versions_dir_name = fs::u8path("versions");
// this class is an implementation detail of `BuiltinRegistryEntry`;
// when `BuiltinRegistryEntry` is using a port versions file for a port,
@@ -72,12 +72,12 @@ namespace
{
return m_versions_tree.get([this, &paths]() -> fs::path {
auto maybe_tree = paths.git_find_object_id_for_remote_registry_path(get_commit_of_repo(paths),
- fs::u8path("port_versions"));
+ registry_versions_dir_name);
if (!maybe_tree)
{
Checks::exit_with_message(
VCPKG_LINE_INFO,
- "Error: could not find the git tree for `port_versions` in repo `%s` at commit `%s`: %s",
+ "Error: could not find the git tree for `versions` in repo `%s` at commit `%s`: %s",
m_repo,
get_commit_of_repo(paths),
maybe_tree.error());
@@ -218,7 +218,7 @@ namespace
const fs::path& path_to_baseline,
StringView identifier = {});
- void load_all_port_names_from_port_versions(std::vector<std::string>& out,
+ void load_all_port_names_from_registry_versions(std::vector<std::string>& out,
const VcpkgPaths& paths,
const fs::path& port_versions_path)
{
@@ -247,11 +247,11 @@ namespace
// { BuiltinRegistry::RegistryImplementation
std::unique_ptr<RegistryEntry> BuiltinRegistry::get_port_entry(const VcpkgPaths& paths, StringView port_name) const
{
- auto versions_path = paths.builtin_port_versions / relative_path_to_versions(port_name);
+ auto versions_path = paths.builtin_registry_versions / relative_path_to_versions(port_name);
if (!m_baseline_identifier.empty() && paths.get_filesystem().exists(versions_path))
{
- auto maybe_version_entries =
- load_versions_file(paths.get_filesystem(), VersionDbType::Git, paths.builtin_port_versions, port_name);
+ auto maybe_version_entries = load_versions_file(
+ paths.get_filesystem(), VersionDbType::Git, paths.builtin_registry_versions, port_name);
Checks::check_maybe_upgrade(
VCPKG_LINE_INFO, maybe_version_entries.has_value(), "Error: " + maybe_version_entries.error());
auto version_entries = std::move(maybe_version_entries).value_or_exit(VCPKG_LINE_INFO);
@@ -300,7 +300,7 @@ namespace
ExpectedS<Baseline> try_parse_builtin_baseline(const VcpkgPaths& paths, StringView baseline_identifier)
{
if (baseline_identifier.size() == 0) return Baseline{};
- auto path_to_baseline = paths.builtin_port_versions / fs::u8path("baseline.json");
+ auto path_to_baseline = paths.builtin_registry_versions / fs::u8path("baseline.json");
auto res_baseline = load_baseline_versions(paths, path_to_baseline, baseline_identifier);
if (!res_baseline.has_value())
@@ -384,9 +384,9 @@ namespace
void BuiltinRegistry::get_all_port_names(std::vector<std::string>& out, const VcpkgPaths& paths) const
{
- if (!m_baseline_identifier.empty() && paths.get_filesystem().exists(paths.builtin_port_versions))
+ if (!m_baseline_identifier.empty() && paths.get_filesystem().exists(paths.builtin_registry_versions))
{
- load_all_port_names_from_port_versions(out, paths, paths.builtin_port_versions);
+ load_all_port_names_from_registry_versions(out, paths, paths.builtin_registry_versions);
}
for (auto port_directory : fs::directory_iterator(paths.builtin_ports_directory()))
@@ -402,7 +402,7 @@ namespace
// { FilesystemRegistry::RegistryImplementation
Baseline parse_filesystem_baseline(const VcpkgPaths& paths, const fs::path& root, StringView baseline_identifier)
{
- auto path_to_baseline = root / port_versions_dir / fs::u8path("baseline.json");
+ auto path_to_baseline = root / registry_versions_dir_name / fs::u8path("baseline.json");
auto res_baseline = load_baseline_versions(paths, path_to_baseline, baseline_identifier);
if (auto opt_baseline = res_baseline.get())
{
@@ -445,9 +445,9 @@ namespace
StringView port_name) const
{
auto maybe_version_entries = load_versions_file(
- paths.get_filesystem(), VersionDbType::Filesystem, m_path / port_versions_dir, port_name, m_path);
+ paths.get_filesystem(), VersionDbType::Filesystem, m_path / registry_versions_dir_name, port_name, m_path);
Checks::check_maybe_upgrade(
- VCPKG_LINE_INFO, maybe_version_entries.has_value(), "Error: " + maybe_version_entries.error());
+ VCPKG_LINE_INFO, maybe_version_entries.has_value(), "Error: %s", maybe_version_entries.error());
auto version_entries = std::move(maybe_version_entries).value_or_exit(VCPKG_LINE_INFO);
auto res = std::make_unique<FilesystemRegistryEntry>(port_name.to_string());
@@ -461,7 +461,7 @@ namespace
void FilesystemRegistry::get_all_port_names(std::vector<std::string>& out, const VcpkgPaths& paths) const
{
- load_all_port_names_from_port_versions(out, paths, m_path / port_versions_dir);
+ load_all_port_names_from_registry_versions(out, paths, m_path / registry_versions_dir_name);
}
// } FilesystemRegistry::RegistryImplementation
@@ -526,7 +526,7 @@ namespace
m_repo,
explicit_hash.error());
}
- auto path_to_baseline = fs::u8path("port_versions") / fs::u8path("baseline.json");
+ auto path_to_baseline = registry_versions_dir_name / fs::u8path("baseline.json");
auto maybe_contents = paths.git_show_from_remote_registry(*explicit_hash.get(), path_to_baseline);
if (!maybe_contents.has_value())
{
@@ -573,7 +573,7 @@ namespace
void GitRegistry::get_all_port_names(std::vector<std::string>& out, const VcpkgPaths& paths) const
{
auto versions_path = get_versions_tree_path(paths);
- load_all_port_names_from_port_versions(out, paths, versions_path);
+ load_all_port_names_from_registry_versions(out, paths, versions_path);
}
// } GitRegistry::RegistryImplementation
@@ -616,7 +616,7 @@ namespace
auto& name = scfl->source_control_file->core_paragraph->name;
return Strings::format(
"Error: no version entry for %s at version %s.\n"
- "We are currently using the version in the ports tree (%s), since no %s.json was found in /port_versions.",
+ "We are currently using the version in the ports tree (%s), since no %s.json was found in /versions.",
name,
version.to_string(),
scfl->to_versiont().to_string(),
@@ -958,7 +958,7 @@ namespace
ExpectedS<std::vector<VersionDbEntry>> load_versions_file(Files::Filesystem& fs,
VersionDbType type,
- const fs::path& port_versions,
+ const fs::path& registry_versions,
StringView port_name,
const fs::path& registry_root)
{
@@ -966,7 +966,7 @@ namespace
!(type == VersionDbType::Filesystem && registry_root.empty()),
"Bug in vcpkg; type should never = Filesystem when registry_root is empty.");
- auto versions_file_path = port_versions / relative_path_to_versions(port_name);
+ auto versions_file_path = registry_versions / relative_path_to_versions(port_name);
if (!fs.exists(versions_file_path))
{
@@ -1180,7 +1180,7 @@ namespace vcpkg
StringView port_name)
{
auto maybe_versions =
- load_versions_file(paths.get_filesystem(), VersionDbType::Git, paths.builtin_port_versions, port_name);
+ load_versions_file(paths.get_filesystem(), VersionDbType::Git, paths.builtin_registry_versions, port_name);
if (auto pversions = maybe_versions.get())
{
return Util::fmap(

MODIFY
src/vcpkg/vcpkgcmdarguments.cpp
src/vcpkg/vcpkgcmdarguments.cpp
@@ -277,7 +277,7 @@ namespace vcpkg
{PACKAGES_ROOT_DIR_ARG, &VcpkgCmdArguments::packages_root_dir},
{SCRIPTS_ROOT_DIR_ARG, &VcpkgCmdArguments::scripts_root_dir},
{BUILTIN_PORTS_ROOT_DIR_ARG, &VcpkgCmdArguments::builtin_ports_root_dir},
- {BUILTIN_PORT_VERSIONS_DIR_ARG, &VcpkgCmdArguments::builtin_port_versions_dir},
+ {BUILTIN_REGISTRY_VERSIONS_DIR_ARG, &VcpkgCmdArguments::builtin_registry_versions_dir},
};
constexpr static std::pair<StringView, std::vector<std::string> VcpkgCmdArguments::*>
@@ -630,7 +630,7 @@ namespace vcpkg
table.format(opt(SCRIPTS_ROOT_DIR_ARG, "=", "<path>"), "(Experimental) Specify the scripts root directory");
table.format(opt(BUILTIN_PORTS_ROOT_DIR_ARG, "=", "<path>"),
"(Experimental) Specify the packages root directory");
- table.format(opt(BUILTIN_PORT_VERSIONS_DIR_ARG, "=", "<path>"),
+ table.format(opt(BUILTIN_REGISTRY_VERSIONS_DIR_ARG, "=", "<path>"),
"(Experimental) Specify the versions root directory");
table.format(opt(JSON_SWITCH, "", ""), "(Experimental) Request JSON output");
}
@@ -920,7 +920,7 @@ namespace vcpkg
constexpr StringLiteral VcpkgCmdArguments::PACKAGES_ROOT_DIR_ARG;
constexpr StringLiteral VcpkgCmdArguments::SCRIPTS_ROOT_DIR_ARG;
constexpr StringLiteral VcpkgCmdArguments::BUILTIN_PORTS_ROOT_DIR_ARG;
- constexpr StringLiteral VcpkgCmdArguments::BUILTIN_PORT_VERSIONS_DIR_ARG;
+ constexpr StringLiteral VcpkgCmdArguments::BUILTIN_REGISTRY_VERSIONS_DIR_ARG;
constexpr StringLiteral VcpkgCmdArguments::DEFAULT_VISUAL_STUDIO_PATH_ENV;

MODIFY
src/vcpkg/vcpkgpaths.cpp
src/vcpkg/vcpkgpaths.cpp
@@ -349,8 +349,8 @@ If you wish to silence this error and use classic mode, you can:
scripts = process_input_directory(filesystem, root, args.scripts_root_dir.get(), "scripts", VCPKG_LINE_INFO);
builtin_ports =
process_output_directory(filesystem, root, args.builtin_ports_root_dir.get(), "ports", VCPKG_LINE_INFO);
- builtin_port_versions = process_output_directory(
- filesystem, root, args.builtin_port_versions_dir.get(), "port_versions", VCPKG_LINE_INFO);
+ builtin_registry_versions = process_output_directory(
+ filesystem, root, args.builtin_registry_versions_dir.get(), "versions", VCPKG_LINE_INFO);
prefab = root / fs::u8path("prefab");
if (args.default_visual_studio_path)
@@ -653,7 +653,7 @@ If you wish to silence this error and use classic mode, you can:
if (!fs.exists(destination))
{
const fs::path destination_tmp = destination_parent / fs::u8path("baseline.json.tmp");
- auto treeish = Strings::concat(commit_sha, ":port_versions/baseline.json");
+ auto treeish = Strings::concat(commit_sha, ":versions/baseline.json");
auto maybe_contents = git_show(treeish, this->root / fs::u8path(".git"));
if (auto contents = maybe_contents.get())
{

[vcpkg] Rename `port_versions` to `versions` (#15784)