Indeed, here is how a go for most of my tests: ``` <get to a fresh terminal> export OPAMROOT=/tmp/temp-opamroot opam init eval $(opam config env) play with it ``` This has the big advantage of being temporary and local to that terminal. A single command is enough if you want to use it in another terminal: `eval $(opam config env --root=/tmp/temp-opamroot)`
If you want to experiment on your current state, though, copying `~/.opam` to /tmp could cause problems because of OCaml relocation issues. So in that case, you'd be safe copying `~/.opam` to a backup before doing dangerous stuff, and restoring it afterwards. Adding this to the Tricks page [1] is probably a good idea, indeed > I know I was unhappy when I tested 1.2 and my repository format was silently > updated to 1.2, making it harder to go back Sorry about that... the release announce warned about it, but you can't be sure everyone will see the message. Cheers, Louis [1] http://opam.ocaml.org/doc/Tricks.html > - Gabriel Scherer, 26/01/2015 15:49 - > opam-devel, is there a recommended fool-proof way to save an opam root > before installing another OPAM version to experiment with it, and be able > to come back to one's usual environment? > > I'd like to test Jon's packages, but I'm a bit wary of losing/corrupting > the dozen of switches I have already. I'm thinking of basically > mv ~/.opam ~/.opam.bak > <uninstall my opam> > <try the packages then uninstall them> > mv ~/.opam.bak ~/.opam > <reinstall my opam> > > If there is nothing wrong with this approach, it might be useful to > document it somewhere -- it's not in the developer manual for example. This > could be useful when asking users to test beta-releases of OPAM as well (I > know I was unhappy when I tested 1.2 and my repository format was silently > updated to 1.2, making it harder to go back). > > On Mon, Jan 26, 2015 at 3:16 PM, Jon Ludlam <[email protected]> > wrote: > > > Hi all, > > > > I'd like to ask for help with testing the RPMs I've built for opam > > for Fedora. > > > > I've submitted a some review requests to get opam into Fedora. This has > > involved getting 6 other packages into RPMs as there was pushback on > > using the bundled libraries as part of the RPM > > (https://bugzilla.redhat.com/show_bug.cgi?id=1060436). These are going > > through the usual process of being reviewed, but I thought it would be > > useful to test them from a functional perspective too. The top-level > > review request is here: > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1185099 > > > > For ease of testing, I have built them using copr, Fedora's build > > service, and the RPMs can be installed directly from there. There > > are instructions on how to do that on the project page: > > > > https://copr.fedoraproject.org/coprs/jonludlam/opam/ > > > > I'd be really grateful if anyone had a few minutes to look and see if > > there's anything obviously wrong with them. > > > > Thanks a lot! > > > > Jon > > > > _______________________________________________ > > opam-devel mailing list > > [email protected] > > http://lists.ocaml.org/listinfo/opam-devel > > _______________________________________________ opam-devel mailing list [email protected] http://lists.ocaml.org/listinfo/opam-devel
