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

Upgrade to opam 2.2 #380

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 bin/opam_monorepo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let cmds = [ Lock.cmd; Pull.cmd; Depext.cmd; List_cmd.cmd ]
let init_opam () =
OpamSystem.init ();
let root = OpamStateConfig.opamroot () in
ignore (OpamStateConfig.load_defaults root);
ignore (OpamStateConfig.load_defaults ~lock_kind:`Lock_read root);
OpamFormatConfig.init ();
OpamCoreConfig.init ~safe_mode:true ();
OpamRepositoryConfig.init ();
Expand Down
8 changes: 4 additions & 4 deletions cli/depext.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ let should_install ~yes pkgs =
pkgs)
~yes

let available_packages pkgs =
match OpamSysInteract.packages_status pkgs with
let available_packages config pkgs =
match OpamSysInteract.packages_status config pkgs with
| available_pkgs, _not_found_pkgs -> Ok available_pkgs
| exception Failure msg -> Error (`Msg msg)

Expand All @@ -31,7 +31,7 @@ let run (`Root root) (`Lockfile explicit_lockfile) dry_run (`Yes yes) () =
else acc)
~init:OpamSysPkg.Set.empty depexts
in
let* pkgs = available_packages pkgs in
let* pkgs = available_packages global_state.config pkgs in
match OpamSysPkg.Set.elements pkgs with
| [] -> Ok ()
| pkgs_list ->
Expand All @@ -42,7 +42,7 @@ let run (`Root root) (`Lockfile explicit_lockfile) dry_run (`Yes yes) () =
else if should_install ~yes pkgs_str then
try
OpamCoreConfig.update ~confirm_level:`unsafe_yes ();
OpamSysInteract.install pkgs;
OpamSysInteract.install global_state.config pkgs;
Ok ()
with Failure msg -> Error (`Msg msg)
else Ok ())
Expand Down
1 change: 1 addition & 0 deletions lib/opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ module Package_flag = struct
| Pkgflag_Compiler -> Fmt.pf pps "compiler"
| Pkgflag_Conf -> Fmt.pf pps "conf"
| Pkgflag_AvoidVersion -> Fmt.pf pps "avoid-version"
| Pkgflag_Deprecated -> Fmt.pf pps "deprecated"
| Pkgflag_Unknown unknown -> Fmt.pf pps "unknown(%s)" unknown
end

Expand Down