Skip to content

Commit f06f284

Browse files
committed
opam config report: add the list of all installed repositories
1 parent 73c671f commit f06f284

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/client/opamCommands.ml

+12-7
Original file line numberDiff line numberDiff line change
@@ -1477,12 +1477,9 @@ let config cli =
14771477
if n <> 0 then [Printf.sprintf "%d (%s)" n label]
14781478
else [] in
14791479
print "jobs" "%d" (Lazy.force OpamStateConfig.(!r.jobs));
1480-
match OpamStateConfig.get_switch_opt () with
1481-
| None -> print "current-switch" "%s" "none set"; `Ok ()
1482-
| Some switch ->
1483-
OpamSwitchState.with_ `Lock_none ~switch gt @@ fun state ->
1484-
print "repositories" "%s"
1485-
(let repos = state.switch_repos.repositories in
1480+
let print_repositories name rt =
1481+
print name "%s"
1482+
(let repos = rt.repositories in
14861483
let default, nhttp, nlocal, nvcs =
14871484
OpamRepositoryName.Map.fold
14881485
(fun _ repo (dft, nhttp, nlocal, nvcs) ->
@@ -1492,7 +1489,7 @@ let config cli =
14921489
then
14931490
OpamRepositoryName.Map.find
14941491
repo.repo_name
1495-
state.switch_repos.repos_definitions |>
1492+
rt.repos_definitions |>
14961493
OpamFile.Repo.stamp
14971494
else dft
14981495
in
@@ -1510,6 +1507,14 @@ let config cli =
15101507
| Some v -> Printf.sprintf " (default repo at %s)" v
15111508
| None -> ""
15121509
);
1510+
in
1511+
OpamRepositoryState.with_ `Lock_none gt @@ fun rt ->
1512+
print_repositories "all-repositories" rt;
1513+
match OpamStateConfig.get_switch_opt () with
1514+
| None -> print "current-switch" "%s" "none set"; `Ok ()
1515+
| Some switch ->
1516+
OpamSwitchState.with_ `Lock_none ~switch gt @@ fun state ->
1517+
print_repositories "repositories" state.switch_repos;
15131518
print "pinned" "%s"
15141519
(if OpamPackage.Set.is_empty state.pinned then "0" else
15151520
let pinnings =

0 commit comments

Comments
 (0)