Module CPM.Repository.CacheFile

This module contains operations implementing a file-based repository cache for faster reading the repository. This file-based implementation is used if the command sqlite3 is not available (compare module CPM.RepositoryCache.Init). The repository cache contains reduced package specifications for faster reading/writing by removing some information which is not relevant for the repository data structure.

The relevant package fields are:

  • small cache: name version dependencies compilerCompatibility
  • large cache: synopsis category sourceDirs exportedModules executableSpec

Author: Michael Hanus

Version: December 2020

Summary of exported operations:

readRepository :: Config -> Bool -> ErrorLogger Repository  Non-deterministic 
Reads all package specifications from the default repository.

Exported operations:

readRepository :: Config -> Bool -> ErrorLogger Repository  Non-deterministic 

Reads all package specifications from the default repository. Uses the cache if it is present or update the cache after reading. If some errors occur, show them and terminate with error exit status.

Example call:
(readRepository cfg large)
Parameters:
  • cfg : the configuration to use
  • large : if true reads the larger cache with more package information (e.g., for searching all packages)