Skip to content

Commit

Permalink
Merge pull request #59 from talex5/update-opam
Browse files Browse the repository at this point in the history
Update to opam 2.2.1
  • Loading branch information
talex5 authored Oct 11, 2024
2 parents 6c53e39 + a62078c commit f48784c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ This package uses 0install's solver algorithm with opam packages.
(depends
(fmt (>= 0.8.7))
(cmdliner (>= 1.1.0))
(opam-state (>= 2.1.0~rc))
(opam-state (>= 2.2.1))
(opam-format (>= 2.2.1))
(ocaml (>= 4.10.0))
0install-solver
(opam-file-format (>= 2.1.1))
(opam-client (and :with-test (< 2.2.0~alpha)))
(opam-client (and :with-test (>= 2.2.1)))
(opam-solver :with-test)
(astring :with-test)
(alcotest :with-test)))
2 changes: 1 addition & 1 deletion lib/dir_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ let filter_deps t pkg f =
let test = OpamPackage.Name.Set.mem (OpamPackage.name pkg) t.test in
f
|> OpamFilter.partial_filter_formula (env t pkg)
|> OpamFilter.filter_deps ~build:true ~post:true ~test ~doc:false ~dev ~default:false
|> OpamFilter.filter_deps ~build:true ~post:true ~test ~doc:false ~dev ~dev_setup:false ~default:false

let version_compare t v1 v2 =
if t.prefer_oldest then
Expand Down
2 changes: 1 addition & 1 deletion lib/switch_context.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let filter_deps t pkg f =
let test = OpamPackage.Name.Set.mem (OpamPackage.name pkg) t.test in
f
|> OpamFilter.partial_filter_formula (env t pkg)
|> OpamFilter.filter_deps ~build:true ~post:true ~test ~doc:false ~dev:false ~default:false
|> OpamFilter.filter_deps ~build:true ~post:true ~test ~doc:false ~dev:false ~dev_setup:false ~default:false

let sort_versions t versions =
if t.prefer_oldest then
Expand Down
5 changes: 3 additions & 2 deletions opam-0install.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ depends: [
"dune" {>= "2.7"}
"fmt" {>= "0.8.7"}
"cmdliner" {>= "1.1.0"}
"opam-state" {>= "2.1.0~rc"}
"opam-state" {>= "2.2.1"}
"opam-format" {>= "2.2.1"}
"ocaml" {>= "4.10.0"}
"0install-solver"
"opam-file-format" {>= "2.1.1"}
"opam-client" {with-test & < "2.2.0~alpha"}
"opam-client" {with-test & >= "2.2.1"}
"opam-solver" {with-test}
"astring" {with-test}
"alcotest" {with-test}
Expand Down
4 changes: 2 additions & 2 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ let select_zi st spec =

let select_opam st spec =
let request = OpamSolver.request ~install:spec () in
let names = List.map fst spec |> Name.Set.of_list in
match OpamSolution.resolve st Install ~orphans:OpamPackage.Set.empty ~requested:names request with
let requested = OpamSwitchState.packages_of_atoms st spec in
match OpamSolution.resolve st Install ~requested request with
| Success s -> Ok (OpamSolver.all_packages s)
| Conflicts c -> Error (lazy (
OpamCudf.string_of_conflicts st.packages (OpamSwitchState.unavailable_reason st) c
Expand Down

0 comments on commit f48784c

Please sign in to comment.