Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OCamlPro/opam
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed Oct 8, 2012
2 parents a5f5c22 + d9fc2cd commit d035ed3
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -41,7 +41,7 @@ clean:
$(MAKE) -C ocp-build clean

distclean: clean
rm -f META Makefile.config src/globals.ml config.log config.status
rm -f META Makefile.config src/opamGlobals.ml config.log config.status
$(MAKE) -C $(SRC_EXT) distclean

.PHONY: tests
Expand Down
2 changes: 2 additions & 0 deletions jenkins/10-opam-prepare.sh
@@ -0,0 +1,2 @@
#!/bin/sh
apt-get -y install ocaml libssl-dev ocaml-compiler-libs
5 changes: 5 additions & 0 deletions jenkins/20-opam-init.sh
@@ -0,0 +1,5 @@
#!/bin/sh -e
rm -rf .opam
./configure --prefix=$HOME/opam-bin
make
make install
12 changes: 12 additions & 0 deletions jenkins/30-opam-packages.sh
@@ -0,0 +1,12 @@
#!/bin/sh -ex
OPAM=$HOME/opam-bin/bin/opam
ROOT=`echo /b/${JOB_NAME} | sed -e s,=,_,g`
rm -rf ${ROOT}
$OPAM --yes --root $ROOT init .
if [ "${compiler}" != "system" ]; then
$OPAM --yes --root $ROOT switch ${compiler}
fi
if [ "${packages}" = "all" ]; then
packages=`$OPAM --root $ROOT list -short`
fi
$OPAM --yes --root $ROOT install ${packages}
13 changes: 13 additions & 0 deletions jenkins/31-opam-mirage-packages.sh
@@ -0,0 +1,13 @@
#!/bin/sh -ex
OPAM=$HOME/opam-bin/bin/opam
ROOT=`echo /b/${JOB_NAME} | sed -e s,=,_,g`
rm -rf ${ROOT}
$OPAM --yes --root $ROOT init .
$OPAM --yes --root $ROOT remote -add dev git://github.com/mirage/opam-repo-dev
if [ "${compiler}" != "system" ]; then
$OPAM --yes --root $ROOT switch ${compiler}
fi
if [ "${packages}" = "all" ]; then
packages=`$OPAM --root $ROOT list -short`
fi
$OPAM --yes --root $ROOT install ${packages}
10 changes: 3 additions & 7 deletions src/opamClient.ml
Expand Up @@ -1075,8 +1075,8 @@ let init_ocaml t quiet alias ocaml_version =
(* NOTE In case it exists 2 '-prefix', in general the script
./configure will only consider the last one, others will be
discarded. *)
; ( "make" :: OpamFile.Comp.make comp )
; [ "make" ; "install" ]
; ( !OpamGlobals.makecmd :: OpamFile.Comp.make comp )
; [ !OpamGlobals.makecmd ; "install" ]
]
end else begin
let t = { t with alias } in
Expand Down Expand Up @@ -2038,11 +2038,7 @@ let upgrade names =
let check_opam_version () =
let t = load_state () in
let n = OpamPackage.Name.of_string "opam" in
let current_version =
let v = match OpamSystem.read_command_output ["opam"; "--version"] with
| s::_ -> List.hd (List.rev (OpamMisc.split s ' '))
| _ -> assert false in
OpamPackage.Version.of_string v in
let current_version = OpamPackage.Version.of_string OpamGlobals.version in
match find_package_by_name t n with
| None -> ()
| Some _ ->
Expand Down
12 changes: 7 additions & 5 deletions src/opamFile.ml
Expand Up @@ -1205,13 +1205,12 @@ module Comp = struct
Syntax.to_string filename {
file_name = OpamFilename.to_string filename;
file_contents = [
Variable (s_opam_version, OpamFormat.make_string (OpamVersion.OPAM.to_string s.opam_version));
Variable (s_name, OpamFormat.make_string (OpamVersion.Compiler.to_string s.name));
] @ (match s.src with
| None -> []
| Some s -> [Variable (s_src, OpamFormat.make_string (OpamFilename.to_string s))]
) @ [
Variable (s_opam_version, OpamFormat.make_string (OpamVersion.OPAM.to_string s.opam_version));
Variable (s_preinstalled, OpamFormat.make_bool s.preinstalled);
Variable (s_patches , OpamFormat.make_list (OpamFilename.to_string |> OpamFormat.make_string) s.patches);
Variable (s_configure , OpamFormat.make_list OpamFormat.make_string s.configure);
Variable (s_make , OpamFormat.make_list OpamFormat.make_string s.make);
Expand All @@ -1223,9 +1222,12 @@ module Comp = struct
Variable (s_packages , OpamFormat.make_formula s.packages);
Variable (s_requires , OpamFormat.make_list (OpamVariable.Section.to_string |> OpamFormat.make_string) s.requires);
Variable (s_env , OpamFormat.make_list OpamFormat.make_env_variable s.env);
] @ match s.pp with
| None -> []
| Some pp -> [ Variable (s_pp, make_ppflag pp) ]
] @ (match s.pp with
| None -> []
| Some pp -> [ Variable (s_pp, make_ppflag pp) ]
) @ [
Variable (s_preinstalled, OpamFormat.make_bool s.preinstalled);
]
}
end
Expand Down
4 changes: 3 additions & 1 deletion src/opamGlobals.ml.in
Expand Up @@ -98,7 +98,7 @@ let os = match Sys.os_type with
| "Cygwin" -> Cygwin
| s -> Other s

let string_of_os = match os with
let string_of_os = function
| Darwin -> "darwin"
| Linux -> "linux"
| FreeBSD
Expand All @@ -108,6 +108,8 @@ let string_of_os = match os with
| Unix -> "unix"
| Other x -> x

let os_string = string_of_os os

let makecmd = ref (match os with FreeBSD | OpenBSD -> "gmake" | _ -> "make") (* WARNING check the result of "which gmake", "which make", ... *)

let default_cores = 1
Expand Down
2 changes: 1 addition & 1 deletion src/opamSystem.ml
Expand Up @@ -456,6 +456,6 @@ let patch =
OpamGlobals.error_and_exit "Patching failed, can not determine the '-p' level to patch."
else if None = try Some (patch ["--dry-run"] n) with _ -> None then
aux (succ n)
else
else
patch [] n in
aux 0
16 changes: 10 additions & 6 deletions src/scripts/opam_repo_check.ml
Expand Up @@ -14,7 +14,7 @@ let () =
let () =
let t = OpamPath.Repository.raw (OpamFilename.cwd ()) in
OpamPackage.Set.iter (fun nv ->
OpamGlobals.msg "Processing %s\n" (OpamPackage.to_string nv);
OpamGlobals.msg "Processing (package) %s\n" (OpamPackage.to_string nv);

(** Descr *)
let descr = OpamPath.Repository.descr t nv in
Expand All @@ -35,8 +35,12 @@ let () =
if OpamFilename.exists dot_install then (
OpamFile.Dot_install.Raw.write dot_install (OpamFile.Dot_install.Raw.read dot_install);
);

(** Comp *)
(* TODO *)

) (OpamRepository.packages t)
) (OpamRepository.packages t);

(** Comp *)
let comps = OpamFilename.list_files (OpamPath.Repository.compilers_dir t) in
List.iter (fun comp ->
let comp_ = OpamFile.Comp.read comp in
OpamGlobals.msg "Processing (compiler) %s\n" (OpamVersion.Compiler.to_string (OpamFile.Comp.name comp_));
OpamFile.Comp.write comp comp_;
) comps

0 comments on commit d035ed3

Please sign in to comment.