Skip to content
Browse files

[switch] env + package fields work as expected in compiler descriptio…

…n files
  • Loading branch information...
1 parent d2b2ee1 commit 0331597848ead5519fd63f21392af456910b2a28 @samoht samoht committed Jun 13, 2012
Showing with 18 additions and 5 deletions.
  1. +4 −2 src/client.ml
  2. +7 −3 tests/Makefile
  3. +7 −0 tests/compilers/dummy.comp
View
6 src/client.ml
@@ -969,7 +969,9 @@ let config request =
let oversion = List.assoc alias aliases in
File.Comp.safe_read (Path.G.compiler t.global oversion) in
let names =
- File.Comp.packages comp
+ List.filter
+ (fun n -> NV.Set.exists (fun nv -> NV.name nv = n) t.installed)
+ (File.Comp.packages comp)
@ List.map Full_section.package c.options in
(* Compute the transitive closure of package dependencies *)
let package_deps =
@@ -1176,7 +1178,7 @@ let switch clone alias ocaml_version =
N.Map.fold (fun name versions list ->
(NV.create name (V.Set.max_elt versions)) :: list
) packages [] in
- let wish_install = List.map vpkg_of_nv_le packages in
+ let wish_install = List.map vpkg_of_nv_eq packages in
resolve `switch t_new
{ wish_install
View
10 tests/Makefile
@@ -56,7 +56,7 @@ run:
$(MAKE) list && \
$(MAKE) switch-alias && \
$(MAKE) list && \
- $(MAKE) switch-env
+ $(MAKE) switch-env-packages
rsync:
$(MAKE) REPOKIND=rsync run
@@ -212,9 +212,13 @@ switch-alias:
$(CHECK) -l switch-alias P1.1 P2.1
$(OPAM) switch -list
-switch-env:
+switch-env-packages:
$(OPAM) switch dummy
- $(OPAM) install P4
+ifeq ($(REPOKIND), git)
+ $(CHECK) -l switch-env-packages P1.1 P2.1 P3.1~weird-version.test P4.3
+else
+ $(CHECK) -l switch-env-packages P1.2 P2.1 P3.1~weird-version.test P4.3
+endif
switch:
$(MAKE) fresh
View
7 tests/compilers/dummy.comp
@@ -0,0 +1,7 @@
+opam-version: "1"
+name: "test"
+preinstalled: true
+env: [
+ [ "TEST" "1" ]
+]
+packages: [ "P4" ]

0 comments on commit 0331597

Please sign in to comment.
Something went wrong with that request. Please try again.