Module CPM.Repository.CacheFile

Author
Michael Hanus
Version
December 2020

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
Exported Functions:

Exported Functions


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.

:: Config  the configuration to use
-> Bool  if true reads the larger cache with more package information (e.g., for searching all packages)
-> ErrorLogger Repository