Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: e67ea03900
Fetching contributors…

Cannot retrieve contributors at this time

130 lines (102 sloc) 3.428 kb
(***********************************************************************)
(* *)
(* Copyright 2012 OCamlPro *)
(* Copyright 2012 INRIA *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Public License version 3.0. *)
(* *)
(* OPAM is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(***********************************************************************)
let debug = ref (
try int_of_string (Sys.getenv "OPAMDEBUG") >= 2
with _ -> false
)
let verbose = ref (
try int_of_string (Sys.getenv "OPAMDEBUG") >= 1
with _ -> false
)
let base_packages = ref true
let verify_checksums = ref true
let yes = ref false
let version = "@PACKAGE_VERSION@"
let default_repository_name = "default"
let default_repository_address = "http://opam.ocamlpro.com"
let default_repository_kind = "curl"
let default_build_command = [ [ "./build.sh" ] ]
let default_package = "conf-ocaml"
let default_compiler_version = "system"
let opam_version = "1"
let home = Unix.getenv "HOME"
let default_opam_path = Filename.concat home ".opam"
let root_path = ref default_opam_path
let log section fmt =
Printf.ksprintf (fun str ->
if !debug then
Printf.eprintf "[%d] %-20s %s\n%!" (Unix.getpid ()) section str
) fmt
let error fmt =
Printf.ksprintf (fun str ->
Printf.eprintf "%s\n%!" str
) fmt
let warning fmt =
Printf.ksprintf (fun str ->
Printf.eprintf "[WARNING] %s\n%!" str
) fmt
exception Exit of int
let error_and_exit fmt =
Printf.ksprintf (fun str ->
error "%s" str;
raise (Exit 66)
) fmt
let msg fmt =
Printf.ksprintf (fun str ->
Printf.printf "%s%!" str
) fmt
type os =
| Darwin
| Linux
| FreeBSD
| OpenBSD
| Cygwin
| Win32
| Unix
| Other of string
let os = match Sys.os_type with
| "Unix" -> begin
match input_line (Unix.open_process_in "uname -s") with
| "Darwin" -> Darwin
| "Linux" -> Linux
| "FreeBSD" -> FreeBSD
| "OpenBSD" -> OpenBSD
| _ -> Unix
end
| "Win32" -> Win32
| "Cygwin" -> Cygwin
| s -> Other s
let string_of_os = function
| Darwin -> "darwin"
| Linux -> "linux"
| FreeBSD
| OpenBSD -> "bsd"
| Cygwin -> "cygwin"
| Win32 -> "win32"
| 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
let version_msg () =
Printf.printf "\
%s version %s
Copyright (C) 2012 OCamlPro - INRIA
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
Sys.argv.(0) version;
exit 0
let exit i =
raise (Exit i)
Jump to Line
Something went wrong with that request. Please try again.