Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Continue on malformed paths in PATH #8129

Merged
merged 2 commits into from
Sep 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion toolsrc/include/vcpkg/base/files.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ namespace vcpkg::Files
virtual void remove_all(const fs::path& path, std::error_code& ec, fs::path& failure_point) = 0;
void remove_all(const fs::path& path, LineInfo li);
bool exists(const fs::path& path, std::error_code& ec) const;
bool exists(LineInfo li, const fs::path& path) const;
bool exists(LineInfo li, const fs::path& path, bool ignore = false) const;
// this should probably not exist, but would require a pass through of
// existing code to fix
bool exists(const fs::path& path) const;
Expand Down
6 changes: 3 additions & 3 deletions toolsrc/src/vcpkg/base/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ namespace vcpkg::Files
return fs::exists(this->symlink_status(path, ec));
}

bool Filesystem::exists(LineInfo li, const fs::path& path) const
bool Filesystem::exists(LineInfo li, const fs::path& path, bool ignore) const
{
std::error_code ec;
auto result = this->exists(path, ec);
if (ec) Checks::exit_with_message(li, "error checking existence of file %s: %s", path.u8string(), ec.message());
if (ec && !ignore) Checks::exit_with_message(li, "error checking existence of file %s: %s", path.u8string(), ec.message());
return result;
}
bool Filesystem::exists(const fs::path& path) const
Expand Down Expand Up @@ -673,7 +673,7 @@ namespace vcpkg::Files
for (auto&& ext : EXTS)
{
auto p = fs::u8path(base + ext.c_str());
if (Util::find(ret, p) == ret.end() && this->exists(VCPKG_LINE_INFO, p))
if (Util::find(ret, p) == ret.end() && this->exists(VCPKG_LINE_INFO, p, true))
{
ret.push_back(p);
Debug::print("Found path: ", p.u8string(), '\n');
Expand Down