Remove unused code

This commit is contained in:
Victor Romero 2019-06-21 16:38:27 -07:00
parent 40140d96d0
commit 2c276442b7
2 changed files with 0 additions and 63 deletions

View File

@ -29,8 +29,4 @@ namespace vcpkg::Paragraphs
std::vector<std::unique_ptr<SourceControlFile>> load_all_ports(const Files::Filesystem& fs,
const fs::path& ports_dir);
std::vector<std::unique_ptr<SourceControlFile>>
load_all_ports_from_dirs(const Files::Filesystem& fs,
const std::vector<std::string>& ports_dirs_paths);
}

View File

@ -286,63 +286,4 @@ namespace vcpkg::Paragraphs
}
return std::move(results.paragraphs);
}
std::vector<std::unique_ptr<SourceControlFile>>
load_all_ports_from_dirs(const Files::Filesystem& fs,
const std::vector<std::string>& ports_dirs_paths)
{
std::set<std::string> found_ports;
std::vector<std::unique_ptr<SourceControlFile>> ret;
for (auto&& ports_path : ports_dirs_paths)
{
if (ports_path.empty())
{
continue;
}
auto overlay = fs::stdfs::canonical(fs::u8path(ports_path));
Checks::check_exit(VCPKG_LINE_INFO,
fs.exists(overlay),
"Error: Path \"%s\" does not exist",
overlay.string());
Checks::check_exit(VCPKG_LINE_INFO,
fs::stdfs::is_directory(overlay),
"Error: Path \"%s\" must be a directory",
overlay.string());
// Is overlay an individual port?
auto maybe_scf = Paragraphs::try_load_port(fs, overlay);
if (auto scf = maybe_scf.get())
{
if (scf->get())
{
auto&& port_name = scf->get()->core_paragraph->name;
if (!found_ports.count(port_name))
{
found_ports.insert(port_name);
ret.emplace_back(std::move(*scf));
}
continue;
}
}
auto found_scf = Paragraphs::load_all_ports(fs, overlay);
for (auto&& scf : found_scf)
{
if (scf.get())
{
auto&& port_name = scf.get()->core_paragraph->name;
if (!found_ports.count(port_name))
{
found_ports.insert(port_name);
ret.emplace_back(std::move(scf));
}
}
}
}
return ret;
}
}