Up

module Distro_cache

: sig

A simple cache for storing key-value pairs on disk. Distributions may wish to use this to record the version(s) of each distribution package currently installed.

#
type package_name = string
#
type machine = string option
#
type entry = Version.t * machine
#
class cache : General.config -> cache_leaf:string -> Support.Common.filepath ->
#
method get : ?if_missing:(package_name -> entry list) -> package_name -> entry list * Distro.quick_test option

Look up an item in the cache.

if_missing called if given and no entries are found. Whatever it returns is cached.
#
method private regenerate_cache : (package_name -> entry -> unit) -> unit

The cache is being regenerated from scratch. If you want to pre-populate the cache, do it here by calling the provided function once for each entry. Otherwise, you can populate it lazily using get ~if_missing.

end