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

Optimisation for partial installability queries #4882

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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 master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ users)
*

## List
*
* Some optimisations to 'opam list --installable' queries combined with other filters [@altgr]

## Show
*
Expand Down
4 changes: 2 additions & 2 deletions src/client/opamCommands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ let list ?(force_search=false) cli =
in
let filter =
OpamFormula.ands [
state_selector;
join
(pattern_selector ::
(if no_switch then Empty else
Expand All @@ -632,7 +631,8 @@ let list ?(force_search=false) cli =
OpamStd.Option.Op.
((owns_file >>| fun f -> Atom (OpamListCommand.Owns_file f)) +!
Empty) ::
List.map (fun x -> Atom x) selection)
List.map (fun x -> Atom x) selection);
state_selector;
]
in
OpamGlobalState.with_ `Lock_none @@ fun gt ->
Expand Down
3 changes: 2 additions & 1 deletion src/client/opamListCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ let apply_selector ~base st = function
| Compiler -> st.compiler_packages
| Available -> Lazy.force st.available_packages
| Installable ->
OpamSolver.installable
OpamSolver.installable_subset
(OpamSwitchState.universe st ~requested:OpamPackage.Name.Set.empty Query)
base
| Pinned -> OpamPinned.packages st
| (Required_by ({recursive=true; _} as tog, atoms)
| Depends_on ({recursive=true; _} as tog, atoms)) as direction ->
Expand Down