You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 2.1.0~alpha3, it's not possible to remove the only repository in a switch, but the user messages and exit codes do not suggest as such.
❭ mkdir /tmp/opam-no-remove-default
❭ cd /tmp/opam-no-remove-default
❭ opam switch create ./ --empty
❭ opam repo
[NOTE] These are the repositories in use by the current switch. Use '--all' to see all configured repositories.
<><> Repository configuration for switch /tmp/opam-no-remove-default ><><><><><>
1 default https://opam.ocaml.org
❭ opam repo remove default
Repositories removed from the selections of switch /tmp/opam-no-remove-default. Use '--all' to forget about them altogether.
❭ opam repo
[NOTE] These are the repositories in use by the current switch. Use '--all' to see all configured repositories.
<><> Repository configuration for switch /tmp/opam-no-remove-default ><><><><><>
1 default https://opam.ocaml.org
I'd expect opam repo remove default to either fail with an appropriate error message or to actually remove the default repository from the switch.
The text was updated successfully, but these errors were encountered:
It is the normal opam behaviour, the opam repo remove documentation should be more precise on this one.
In fact, opam won't let switch with no repository (if there is a default one defined). So when the switch unique repository is removed, it sets the global config default one. In this case, you deleted the default and it has been replaced by the default.
The behaviour seems to be a remnant from the code that was used to migrate from older opam roots without switch-specific repositories; I see no reason to forbid repository-less switches (although they probably won't be useful). But least surprise, etc.
On
2.1.0~alpha3
, it's not possible to remove the only repository in a switch, but the user messages and exit codes do not suggest as such.I'd expect
opam repo remove default
to either fail with an appropriate error message or to actually remove thedefault
repository from the switch.The text was updated successfully, but these errors were encountered: