Up

module Stores

: sig

Managing cached implementations

#
type stores = Support.Common.filepath list
#
type available_digests = (string, Support.Common.filepath) Hashtbl.t
#
exception Not_stored of string
#
val lookup_maybe : Support.Common.system -> Manifest.digest list -> stores -> Support.Common.filepath option
#
val lookup_any : Support.Common.system -> Manifest.digest list -> stores -> string
#
val get_default_stores : Support.Common.system -> Support.Basedir.basedirs -> stores
#
val get_available_digests : Support.Common.system -> stores -> available_digests

Scan all the stores and build a set of the available digests. This can be used later to quickly test whether a digest is in the cache.

#
val check_available : available_digests -> Manifest.digest list -> bool
#
val get_digests : [<
| `implementation
| `selection
] Element.t -> Manifest.digest list
#
val best_digest : Manifest.digest list -> Manifest.digest
#
val fixup_permissions : Support.Common.system -> Support.Common.filepath -> unit

Recursively set permissions: Directories and executable files become 0o555. Other files become 0o444.

Raises Safe_exception if there are special files or files with special mode bits set
#
val make_tmp_dir : Support.Common.system -> stores -> Support.Common.filepath

Create a temporary directory in the directory where we would store a new implementation. This is used to set up a new implementation before being renamed if it turns out OK.

#
val check_manifest_and_rename : General.config -> Manifest.digest -> Support.Common.filepath -> unit Lwt.t
#
val add_dir_to_cache : General.config -> Manifest.digest -> Support.Common.filepath -> unit Lwt.t
end