[ocaml-platform] opam without internet access

Hendrik Tews Hendrik.Tews at FireEye.com
Wed Mar 23 22:21:39 GMT 2016


Hi,

I am trying to use opam on a machine without internet access. I
got it working with some glitches, I would like to ask here for
advice.

On a machine with internet access I do

   git clone git://github.com/ocaml/opam-repository
   cd opam-repository
   opam-admin make

The last command downloads the sources of all packages into the
archives subdir. I then physically move the opam-repository
directory to the machine without internet access and there I do

   opam init local /path/to/opam-repository

I can now install packages without internet connection because
opam accesses the sources in the archives subdir.

However, when I do opam switch for installing a different
compiler, opam wants to download the OCaml sources from the inria
website.

Is there a way to instruct opam-admin to download and cache the
compiler sources too? I am using now the following workaround: I
modify the URL in the src field of the .comp file of the few
compiler versions that I am interested in and copy the source
file manually into the right location.

I now have 2 questions for opam-admin make. Firstly, is there a
way to restrict to restrict the download of the sources to the
latest two stable versions? I mean, it is great that I can
install every version of utop from 1.2.1 to 1.18.2, but I don't
really need that flexibility.

Secondly, the archives subdir is present already on
http://opam.ocaml.org/ . Is there a way to instruct opam-admin to
download package sources from there without rebuilding them
locally?

Thanks in advance,

Hendrik Tews

This email and any attachments thereto may contain private, confidential, and/or privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments thereto) by others is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete the original and any copies of this email and any attachments thereto.


More information about the Platform mailing list