ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.21k stars 347 forks source link

Handle doas in place of sudo if available, outside of OpenBSD #4991

Open kit-ty-kate opened 2 years ago

kit-ty-kate commented 2 years ago

Alpine Linux officially started the migration from sudo to doas in Alpine 3.15 (https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.15.0#Move_from_sudo_to_doas).

It would be interesting to automatically use doas if it is present in place of sudo when sudo is not available (or if configured to do so). There doesn’t seem to be any automated way to detect if one or the other is configured so I’d say we should probably:

dra27 commented 2 years ago

For the case where they're both found, let's "prefer" sudo (on the basis that if it and doas are present then sudo was added explicitly and probably configured) but then display a warning that sudo has been used and advise the required opam config command to set the preference permanently between doas and sudo (cf. various git things)