ocaml/opam — pull request #1635 by lefessan (2014-08-21 13:42:12+00:00)
Title: patch to combine "remove -a --force"

The current behavior of "opam remove -a" is to remove only packages that are not root packages. Sometimes, it is useful to "completely clean" a repository. We propose to use the combination of "-a" and "--force" to achieve this goal (combining "--force" with "-a" made no sense before as "--force" expects arguments while "-a" does not). When used together with this patch, these options will remove all packages from the switch, except "base-*" packages ("base-bytes" is removed, as it is not installed by ocaml itself).

Note that we use the heuristic that packages installed by ocaml starts with "base-", but it would be better to have another way to find them, as the example of "base-bytes" demonstrates.