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

opam config report: add the list of all installed repositories #5799

Closed

Conversation

kit-ty-kate
Copy link
Member

Looking at #5798 we can’t see the list of repositories in the output of opam config report because repositories 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.

@kit-ty-kate kit-ty-kate force-pushed the config-report-all-repositories branch from f06f284 to 86af45e Compare January 23, 2024 14:01
@kit-ty-kate kit-ty-kate force-pushed the config-report-all-repositories branch from 86af45e to 7d14d4b Compare July 2, 2024 11:08
@kit-ty-kate kit-ty-kate added this to the 2.3.0~alpha milestone Jul 9, 2024
@kit-ty-kate kit-ty-kate requested a review from rjbou July 9, 2024 17:36
Comment on lines +1522 to +1527
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;
Copy link
Collaborator

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

Copy link
Member Author

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)

Copy link
Collaborator

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

Copy link
Collaborator

@rjbou rjbou left a 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.

Comment on lines +1522 to +1527
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;
Copy link
Collaborator

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

@kit-ty-kate
Copy link
Member Author

Superseded by #6116

@kit-ty-kate kit-ty-kate deleted the config-report-all-repositories branch July 24, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants