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

confirm level/yes/no: better answer computation #4691

Merged
merged 3 commits into from
Jun 4, 2021

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Jun 1, 2021

Automatic answering depends on several parameters: confirm-level, yes, and no cli flags and environment variables.
In #4582, environment computes an answer, cli flags another one, and those answers were compared to set the run answering (cli > env var). That lead to #4682.
One solution is to check each parameters against its environment variable / cli flags, and then compute the automatic answering. So in OpamCore.Config.!r, answer is no more set, but confirm_level and yes fields, and a new function permits to retrieve this answer OpamCoreConfig.answer (lazy).
One side effect of this mechanism is that if OPAMCONFIRMLEVEL is set in the environment, --yes/--no are ignored (as confirm-level > yes/no), and it can be resset only by using --confirm-level.

@rjbou rjbou added this to the 2.1.0~rc milestone Jun 1, 2021
@rjbou rjbou linked an issue Jun 2, 2021 that may be closed by this pull request
@rjbou rjbou force-pushed the confirm-level-cli branch from a3f6269 to 1cef962 Compare June 2, 2021 09:45
@rjbou rjbou force-pushed the confirm-level-cli branch from 051f93c to 90b2509 Compare June 3, 2021 10:17
@rjbou rjbou merged commit 9d19f36 into ocaml:master Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

opam-2.1 install -y fails
1 participant