On Tue, Apr 2, 2013 at 3:52 AM, Thomas Gazagnaire <span dir="ltr"><<a href="mailto:thomas@ocamlpro.com" target="_blank">thomas@ocamlpro.com</a>></span> wrote:<br><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
In an init script, you don't need to eval `opam config env`, you can just source ~/.opam/opam-config/init.sh.</blockquote><div><br></div><div>I don't see how this is possible. My variables.sh file is:<br></div><div>
<br></div><div><div>$ cat variables.sh </div><div>CAML_LD_LIBRARY_PATH=/Users/ashish/.opam/4.00.1/lib/stublibs; export CAML_LD_LIBRARY_PATH;</div><div>OCAML_TOPLEVEL_PATH=/Users/ashish/.opam/4.00.1/lib/toplevel; export OCAML_TOPLEVEL_PATH;</div>
<div>MANPATH=/Users/ashish/.opam/4.00.1/man:$MANPATH; export MANPATH;</div><div>PATH=/Users/ashish/.opam/4.00.1/bin:$PATH; export PATH;</div></div><div><br></div><div>All path variables have a specific switch hardcoded in. When I do `opam switch foo`, these paths will be wrong.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And after a switch you still need eval, because you want to dynamically rewrite the contents of some of your variables</blockquote>
<div><br></div><div>Right, so thus I have to eval `opam config env` in my login scripts too. Otherwise, my path variables will always be whatever is in the above variables.sh script.</div><div><br></div></div>