Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 261 lines (187 sloc) 8.135 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260
(***********************************************************************)
(* *)
(* Copyright 2012 OCamlPro *)
(* Copyright 2012 INRIA *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Public License version 3.0. *)
(* *)
(* TypeRex 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. *)
(* *)
(***********************************************************************)

(** Typed filename management. *)

open Types

(** Compiler-version related state *)
module C: sig

  (** Contains {i $opam} and {i $OVERSION} *)
  type t

  (** Create a compiler path *)
  val create: Alias.t -> t

  (** Root dir: {i $opam/$OVERSION} *)
  val root: t -> dirname
   
  (** Library path for a given package:
{i $opam/$OVERSION/lib/NAME} *)
  val lib: t -> N.t -> dirname

  (** Library path: {i $opam/$OVERSION/lib/} *)
  val lib_dir: t -> dirname

  (** DLL paths *)
  val stublibs: t -> dirname

  (** toplevel path: {i $opam/$OVERSION/lib/toplevel} *)
  val toplevel: t -> dirname

  (** Documentation path for a given package:
{i $opam/$OVERSION/doc/NAME} *)
  val doc: t -> N.t -> dirname

  (** Documentation path: {i $opam/$OVERSION/doc/} *)
  val doc_dir: t -> dirname

  (** Installed binaries: {i $opam/$OVERSION/bin} *)
  val bin: t -> dirname

  (** List of installed packages with their version:
{i $opam/$OVERSION/installed} *)
  val installed: t -> filename

  (** Tempory folders used to decompress and compile
the corresponding archives:
{i $opam/$OVERSION/build/$NAME-$VERSION} *)
  val build: t -> NV.t -> dirname

  (** Tempory folders used to decompress and compile
the OCaml compiler:
{i $opam/$OVERSION/build/_} *)
  val build_ocaml: t -> dirname

  (** Tempory folder: {i $opam/$OVERSION/build} *)
  val build_dir: t -> dirname

  (** A file containing the env variables in which build command are
processed: {i $opam/$OVERSION/build/$NAME.$VERSION/$NAME.env} *)
  val build_env: t -> NV.t -> filename

  (** A file containing a copy of the current env variables, before
the env variables for the build are set:
{i $opam/$OVERSION/build/$NAME.$VERSION/$NAME.old.env} *)
  val build_old_env: t -> NV.t -> filename

  (** Tempory location of install files:
{i $opam/$OVERSION/build/$NAME.$VERSION/$NAME.install} *)
  val build_install: t -> NV.t -> filename

  (** Tempory location of config files: {i
$opam/$OVERSION/build/$NAME.$VERSION/$NAME.config} *)
  val build_config: t -> NV.t -> filename

  (** Installed files for a given package:
{i $opam/$OVERSION/install/$NAME.install} *)
  val install: t -> N.t -> filename

  (** Installed files: {i $opam/$OVERSION/install/} *)
  val install_dir: t -> dirname
    
  (** Packages to reinstall on next upgrade:
{i $opam/$OVERSION/reinstall} *)
  val reinstall: t -> filename

  (** Compile and link flags for a given package:
{i $opam/$OVERSION/config/$NAME.config} *)
  val config: t -> N.t -> filename

  (** Configuration folder: {i $opam/$OVERSION/config} *)
  val config_dir: t -> dirname

  (** Pinned package file *)
  val pinned: t -> filename
end

(** Global state *)
module G: sig

  (** Contains {i $opam} *)
  type t

  (** Create a global path *)
  val create: unit -> t

  (** Root dir: {i $opam/} *)
  val root: t -> dirname

  (** Main configuration file: {i $opam/config} *)
  val config: t -> filename

  (** Compiler aliases *)
  val aliases: t -> filename

  (** OPAM files: {i $opam/opam/$NAME.$VERSION.opam} *)
  val opam: t -> NV.t -> filename

  (** Compiler files: {i $opam/compilers/$OVERSION.comp} *)
  val compiler: t -> OCaml_V.t -> filename

  (** Compiler files: {i $opam/compilers/} *)
  val compiler_dir: t -> dirname

  (** All the compiler files *)
  val compiler_list: t -> OCaml_V.Set.t

  (** List all the available packages:
{i $opam/opam/$NAME.$VERSION.opam} *)
  val available: t -> NV.Set.t

  (** List all the available packages:
{i $opam/opam/$NAME.$VERSION.opam} *)
  val available_versions: t -> N.t -> V.Set.t

  (** Description file: {i $opam/descr/$NAME.$VERSION} *)
  val descr: t -> NV.t -> filename

  (** Archives files: {i $opam/archives/$NAME.$VERSION.tar.gz} *)
  val archive: t -> NV.t -> filename

  (** OPAM files folder: {i $opam/opam/} *)
  val opam_dir: t -> dirname

  (** Description files folder: {i $opam/descr/} *)
  val descr_dir: t -> dirname

  (** Archives files folder: {i $opam/archives/} *)
  val archive_dir: t -> dirname

  (** Return the repository index: {i $opam/repo/index} *)
  val repo_index: t -> filename

  (** Folding on available compiler, including the one that is currently set.
The order of folding on version is not precised. *)
  val fold_compiler: ('a -> C.t -> 'a) -> 'a -> t -> 'a

end

(** Repository related *)
module R: sig

  type t

  (** Create a repository path *)
  val create: repository -> t

  (** Transform a directory name into a repository path *)
  val of_path: dirname -> t

  (** Return the repository folder: {i $opam/repo/$repo} *)
  val root: t -> dirname

  (** Return the repository config: {i $opam/repo/$repo/config} *)
  val config: t -> filename

  (** Return the OPAM file for a given package:
{i $opam/repo/$repo/opam/$NAME.$VERSION.opam} *)
  val opam: t -> NV.t -> filename

  (** Return the OPAM folder: {i $opam/repo/$repo/opam/} *)
  val opam_dir: t -> dirname

  (** List all the available packages:
{i $opam/repo/$repo/$NAME.$VERSION.opam} *)
  val available: t -> NV.Set.t

  (** List all the available versions for a given package:
{i $opam/repo/$repo/$name.$VERSION.opam} *)
  val available_versions: t -> N.t -> V.Set.t

  (** Return the description file for a given package:
{i $opam/repo/$repo/descr/$NAME.VERSION} *)
  val descr: t -> NV.t -> filename

  (** Return the description folder *)
  val descr_dir: t -> dirname

  (** Return the archive for a giben package:
{i $opam/repo/$repo/archives/$NAME.$VERSION.tar.gz} *)
  val archive: t -> NV.t -> filename

  (** Return the archive folder: {i $opam/repo/$repo/archives/} *)
  val archive_dir: t -> dirname

  (** Return the list of updated packages:
{i $opam/repo/$repo/updated} *)
  val updated: t -> filename

  (** Return the upload folder for a given version:
{i $opam/repo/$repo/upload/} *)
  val upload: t -> dirname

  (** Return the upload folder for OPAM files:
{i $opam/repo/$repo/upload/opam/}*)
  val upload_opam_dir: t -> dirname

  (** Return the upload folder for descr files:
{i $opam/repo/$repo/upload/descr/} *)
  val upload_descr_dir: t -> dirname

  (** Return the upload folder for archive files:
{i $opam/repo/$repo/upload/archives/} *)
  val upload_archives_dir: t -> dirname

  (** Return the upload folder for OPAM files:
{i $opam/repo/$repo/upload/opam/$NAME.$VERSION.opam}*)
  val upload_opam: t -> NV.t -> filename

  (** Return the upload folder for descr files:
{i $opam/repo/$repo/upload/descr/$NAME.$VERSION} *)
  val upload_descr: t -> NV.t -> filename

  (** Return the upload folder for archive files:
{i $opam/repo/$repo/upload/archives/$NAME.$VERSION.tar.gz} *)
  val upload_archives: t -> NV.t -> filename

  (** Compiler files: {i $opam/repo/$repo/compilers/$OVERSION.comp} *)
  val compiler: t -> OCaml_V.t -> filename

  (** Compiler files: {i $opam/repo/$repo/compilers/} *)
  val compiler_dir: t -> dirname

  (** All the compiler files *)
  val compiler_list: t -> OCaml_V.Set.t

end
Something went wrong with that request. Please try again.