diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2021-01-22 12:26:01 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-22 12:26:01 -0800 |
| commit | 3b433e5081f35a32331492d98a8b0c1c2477048e (patch) | |
| tree | 46757161cc74030197cb40ee22d9fa5efa4bbb6f /toolsrc/include | |
| parent | 0e4d6f084f95584b7fc7460509821115f1868d30 (diff) | |
| download | vcpkg-3b433e5081f35a32331492d98a8b0c1c2477048e.tar.gz vcpkg-3b433e5081f35a32331492d98a8b0c1c2477048e.zip | |
[vcpkg] Fix regression in error messages with registries/versioning (#15709)
* [vcpkg] Fix regression in error messages with registries/versioning
* [vcpkg] Clean up redundant re-parsing with try_load_overlay_port
* [vcpkg] Deduplicate PathsPortfileProvider
* [vcpkg] Restore uses of Checks::exit_maybe_upgrade after merge
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/paragraphs.h | 2 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/portfileprovider.h | 26 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/registries.h | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h index 0293f0733..b376eef81 100644 --- a/toolsrc/include/vcpkg/paragraphs.h +++ b/toolsrc/include/vcpkg/paragraphs.h @@ -56,5 +56,5 @@ namespace vcpkg::Paragraphs LoadResults try_load_all_registry_ports(const VcpkgPaths& paths); std::vector<SourceControlFileLocation> load_all_registry_ports(const VcpkgPaths& paths); - std::vector<SourceControlFileLocation> load_overlay_ports(const VcpkgPaths& paths, const fs::path& dir); + std::vector<SourceControlFileLocation> load_overlay_ports(const Files::Filesystem& fs, const fs::path& dir); } diff --git a/toolsrc/include/vcpkg/portfileprovider.h b/toolsrc/include/vcpkg/portfileprovider.h index d297af739..979004f94 100644 --- a/toolsrc/include/vcpkg/portfileprovider.h +++ b/toolsrc/include/vcpkg/portfileprovider.h @@ -28,18 +28,6 @@ namespace vcpkg::PortFileProvider const std::unordered_map<std::string, SourceControlFileLocation>& ports; }; - struct PathsPortFileProvider : Util::ResourceBase, PortFileProvider - { - explicit PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, const std::vector<std::string>& overlay_ports); - ExpectedS<const SourceControlFileLocation&> get_control_file(const std::string& src_name) const override; - std::vector<const SourceControlFileLocation*> load_all_control_files() const override; - - private: - const VcpkgPaths& paths; - std::vector<fs::path> overlay_ports; - mutable std::unordered_map<std::string, SourceControlFileLocation> cache; - }; - struct IVersionedPortfileProvider { virtual View<VersionT> get_port_versions(StringView port_name) const = 0; @@ -47,6 +35,7 @@ namespace vcpkg::PortFileProvider virtual ExpectedS<const SourceControlFileLocation&> get_control_file( const Versions::VersionSpec& version_spec) const = 0; + virtual void load_all_control_files(std::map<std::string, const SourceControlFileLocation*>& out) const = 0; }; struct IBaselineProvider @@ -59,6 +48,19 @@ namespace vcpkg::PortFileProvider { virtual ~IOverlayProvider() = default; virtual Optional<const SourceControlFileLocation&> get_control_file(StringView port_name) const = 0; + virtual void load_all_control_files(std::map<std::string, const SourceControlFileLocation*>& out) const = 0; + }; + + struct PathsPortFileProvider : Util::ResourceBase, PortFileProvider + { + explicit PathsPortFileProvider(const vcpkg::VcpkgPaths& paths, const std::vector<std::string>& overlay_ports); + ExpectedS<const SourceControlFileLocation&> get_control_file(const std::string& src_name) const override; + std::vector<const SourceControlFileLocation*> load_all_control_files() const override; + + private: + std::unique_ptr<IBaselineProvider> m_baseline; + std::unique_ptr<IVersionedPortfileProvider> m_versioned; + std::unique_ptr<IOverlayProvider> m_overlay; }; std::unique_ptr<IBaselineProvider> make_baseline_provider(const vcpkg::VcpkgPaths& paths); diff --git a/toolsrc/include/vcpkg/registries.h b/toolsrc/include/vcpkg/registries.h index 74782859d..9c07f1a60 100644 --- a/toolsrc/include/vcpkg/registries.h +++ b/toolsrc/include/vcpkg/registries.h @@ -54,8 +54,6 @@ namespace vcpkg View<std::string> packages() const { return packages_; } const RegistryImplementation& implementation() const { return *implementation_; } - static std::unique_ptr<RegistryImplementation> builtin_registry(std::string&& baseline = {}); - friend RegistrySet; // for experimental_set_builtin_registry_baseline private: |
