Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add an option to not install the base packages on init

This is helpful when the initial repository is empty (and thus does not contain the description for the base package) as it is the case in the tests.
  • Loading branch information...
commit 640a3baf3cd5d5a1ef80f21a65f173a027652b1f 1 parent ffc1882
@samoht samoht authored
View
7 src/client.ml
@@ -324,7 +324,10 @@ let create_default_compiler_description t =
let f =
File.Comp.create_preinstalled
ocaml_version
- [ mk "base-threads"; mk "base-unix"; mk "base-bigarray"; mk "base-threads" ]
+ (if !Globals.base_packages then
+ [ mk "base-threads"; mk "base-unix"; mk "base-bigarray"; mk "base-threads" ]
+ else
+ [])
[ ("CAML_LD_LIBRARY_PATH", "+=", Dirname.to_string (Path.C.stublibs t.compiler))] in
let comp = Path.G.compiler t.global ocaml_version in
File.Comp.write comp f
@@ -835,7 +838,7 @@ module Heuristic = struct
let available = NV.to_map t.available in
List.rev_map
(function
- | (name, _), None ->
+ | (name, _), None ->
let name = N.of_string name in
f_h None (N.Map.find name available) name
| n, v -> n, v)
View
2  src/globals.ml
@@ -23,6 +23,8 @@ let verbose = ref (
with _ -> false
)
+let base_packages = ref true
+
let yes = ref false
let version = "0.2"
View
4 src/opam.ml
@@ -86,7 +86,8 @@ let init =
("-comp" , Arg.Set_string comp , " Which compiler version to use");
("-alias", Arg.Set_string alias, " Set the compiler alias name");
("-cores", Arg.Set_int cores , " Set the nomber of cores");
- ("-kind" , Arg.Set_string kind , " Set the repository kind")
+ ("-kind" , Arg.Set_string kind , " Set the repository kind");
+ ("-no-base-packages", Arg.Clear Globals.base_packages, " Do not install the base packages");
];
anon;
main =
@@ -310,6 +311,7 @@ let switch =
("-clone" , Arg.Set clone , " Try to keep the same installed packages");
("-list" , Arg.Unit (set `list) , " List the available compiler descriptions");
("-alias" , Arg.Set_string alias , " Set the compiler name");
+ ("-no-base-packages", Arg.Clear Globals.base_packages, " Do not install the base packages");
];
anon;
main = parse_args (fun args ->
View
4 tests/Makefile
@@ -94,7 +94,7 @@ ifeq ($(REPOKIND), git)
touch README && git add README && \
git commit -a -m "Initial commit"
endif
- $(OPAM) init $(REPO) $(OPAM_REPO) -kind $(REPOKIND)
+ $(OPAM) init -no-base-packages $(REPO) $(OPAM_REPO) -kind $(REPOKIND)
upload: $(ARCHIVES)
ifeq ($(REPOKIND), git)
@@ -210,7 +210,7 @@ downgrade:
switch-alias:
$(OPAM) remove P3.1~weird-version.test P4.2
$(CHECK) -l switch-alias P1.1 P2.1
- $(OPAM) switch -alias test $(OCAMLVERSION) -clone
+ $(OPAM) switch -alias test $(OCAMLVERSION) -clone -no-base-packages
$(CHECK) -l switch-alias-test P1.1 P2.1
$(OPAM) switch 4.00.0
$(OPAM) install P1
Please sign in to comment.
Something went wrong with that request. Please try again.