-
Notifications
You must be signed in to change notification settings - Fork 280
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
More expressive checks in triplet/port #1379
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes other than is_overlay_port
look good to me.
src/vcpkg/vcpkgpaths.cpp
Outdated
@@ -834,6 +834,11 @@ namespace vcpkg | |||
.map([](Path&& dot_git_parent) { return std::move(dot_git_parent) / ".git"; }); | |||
} | |||
|
|||
bool VcpkgPaths::is_overlay_port(const std::string& port_name) const | |||
{ | |||
return Util::contains(overlay_ports, port_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure overlay_ports is a list of directories and thus this change won't behave correctly. Can you add tests for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure overlay_ports is a list of directories and thus this change won't behave correctly.
At least the name and type suggests that these are in fact port names.
Can you add tests for this?
Do you mean unit tests or e2e tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least the name and type suggests that these are in fact port names.
I believe the name is based on the name of the switch being --overlay-ports
.
Do you mean unit tests or e2e tests?
Of course unit tests are better but I doubt we have great ways to do that.
@@ -834,6 +834,13 @@ namespace vcpkg | |||
.map([](Path&& dot_git_parent) { return std::move(dot_git_parent) / ".git"; }); | |||
} | |||
|
|||
bool VcpkgPaths::is_overlay_port(StringView port_name) const | |||
{ | |||
return std::find_if(overlay_ports.begin(), overlay_ports.end(), [&port_name](StringView port_dir) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't right either because direct overlay-ports don't care about the directory name. Can you just revert the behavior for this one to how it was before?
This makes it more clear what is actually checked here.