-
Notifications
You must be signed in to change notification settings - Fork 371
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
opam config report: add the list of all installed repositories #5799
opam config report: add the list of all installed repositories #5799
Conversation
f06f284
to
86af45e
Compare
86af45e
to
7d14d4b
Compare
print_repositories "all-repositories" rt; | ||
match OpamStateConfig.get_switch_opt () with | ||
| None -> print "current-switch" "%s" "none set"; `Ok () | ||
| Some switch -> | ||
OpamSwitchState.with_ `Lock_none ~switch gt @@ fun state -> | ||
print_repositories "repositories" state.switch_repos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the difference between all-repositories
and repositories
fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repositories
only shows the list of repositories from the current switch.
all-repositories
shows all of them (as in: opam repository list -a
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... It is then the wrong value used: rt
= state.switch_repos
, to access to switch state repos, it is state.switch_config.repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previous repository
field was already listing all repositories, the pointed issue is that it is not shown if no switch is present.
We can change the behaviour (in another PR as it is not part of the fix), and have the 2 fields: one listing all repositories, and the other current switch repositories. In that case, it's better to minisie the change of behaviour by keeping repositories
for all repositories and have a new one, for example switch-repositories
, for switch ones.
print_repositories "all-repositories" rt; | ||
match OpamStateConfig.get_switch_opt () with | ||
| None -> print "current-switch" "%s" "none set"; `Ok () | ||
| Some switch -> | ||
OpamSwitchState.with_ `Lock_none ~switch gt @@ fun state -> | ||
print_repositories "repositories" state.switch_repos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... It is then the wrong value used: rt
= state.switch_repos
, to access to switch state repos, it is state.switch_config.repos
Superseded by #6116 |
Looking at #5798 we can’t see the list of repositories in the output of
opam config report
becauserepositories
only shows when the current switch is set. Having the list of all the repositories at all time is in my opinion very useful for this kind of issues.