aboutsummaryrefslogtreecommitdiff
path: root/src/clients/cave/cmd_find_candidates.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/cave/cmd_find_candidates.cc')
-rw-r--r--src/clients/cave/cmd_find_candidates.cc30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/clients/cave/cmd_find_candidates.cc b/src/clients/cave/cmd_find_candidates.cc
index 3cf1789f1..62754b51b 100644
--- a/src/clients/cave/cmd_find_candidates.cc
+++ b/src/clients/cave/cmd_find_candidates.cc
@@ -186,19 +186,35 @@ FindCandidatesCommand::run_hosted(
{
if (search_options.a_all_versions.specified())
{
- const std::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
- generator::Package(*q))]);
- check_candidates(yield, step, ids);
+ if (search_options.a_visible.specified())
+ {
+ const auto ids((*env)[selection::AllVersionsUnsorted(generator::Package(*q))]);
+ check_candidates(yield, step, ids);
+ }
+ else
+ {
+ const auto ids((*env)[selection::AllVersionsUnsorted(generator::Package(*q) | filter::NotMasked())]);
+ check_candidates(yield, step, ids);
+ }
}
else
{
std::shared_ptr<const PackageIDSequence> ids;
ids = ((*env)[selection::BestVersionOnly(generator::Package(*q) | filter::SupportsAction<InstallAction>() | filter::NotMasked())]);
- if (ids->empty())
- ids = ((*env)[selection::BestVersionOnly(generator::Package(*q) | filter::SupportsAction<InstallAction>())]);
- if (ids->empty())
- ids = ((*env)[selection::BestVersionOnly(generator::Package(*q))]);
+
+ if (search_options.a_visible.specified())
+ {
+ if (ids->empty())
+ ids = ((*env)[selection::BestVersionOnly(generator::Package(*q) | filter::NotMasked())]);
+ }
+ else
+ {
+ if (ids->empty())
+ ids = ((*env)[selection::BestVersionOnly(generator::Package(*q) | filter::SupportsAction<InstallAction>())]);
+ if (ids->empty())
+ ids = ((*env)[selection::BestVersionOnly(generator::Package(*q))]);
+ }
check_candidates(yield, step, ids);
}