Skip to content

Commit

Permalink
Merge pull request ocaml#199 from tuong/master
Browse files Browse the repository at this point in the history
add new variables %{enable}% and %{disable}%
  • Loading branch information
samoht committed Sep 26, 2012
2 parents 022a533 + 412fd72 commit 37df039
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions src/client.ml
Expand Up @@ -586,15 +586,21 @@ let update_packages t ~show_packages repos =
(N.to_string name)
(V.to_string version);
has_error := true);
let depends = File.OPAM.depends opam in
let depopts = File.OPAM.depopts opam in
List.iter (List.iter (fun ((d,_),_) ->
let map_b b = List.map (List.map (fun s -> b, s)) in
let depends = map_b true (File.OPAM.depends opam) in
let depopts = map_b false (File.OPAM.depopts opam) in
List.iter (List.iter (fun (raise_err, ((d,_),_)) ->
match find_available_package_by_name t (N.of_string d) with
| None ->
let _ = Globals.error
"Package %s depends on the unknown package %s"
(N.to_string (NV.name nv)) d in
has_error := true
if raise_err then
let _ = Globals.error
"Package %s depends on the unknown package %s"
(NV.to_string nv) d in
has_error := true
else
Globals.warning
"Package %s depends optionally on the unknown package %s"
(NV.to_string nv) d
| Some _ -> ()
)) (depends @ depopts)
) (get_available_current t);
Expand Down
2 changes: 1 addition & 1 deletion src/file.ml
Expand Up @@ -659,7 +659,7 @@ module OPAM = struct
List.map (fun (s, v) -> Variable (s, v)) t.others;
} in
Syntax.to_string
~indent_variable:(fun s -> List.mem s [s_build ; s_depends ; s_depopts])
~indent_variable:(fun s -> List.mem s [s_build ; s_remove ; s_depends ; s_depopts])
filename s
let of_string filename str =
Expand Down

0 comments on commit 37df039

Please sign in to comment.