Module CPM.PackageCache.Global

This module contains functions for accessing and modifying the global package cache.

Summary of exported operations:

emptyCache :: GlobalCache  Deterministic 
An empty package cache.
allPackages :: GlobalCache -> [Package]  Deterministic 
Gets all package specifications from a cache.
findAllVersions :: GlobalCache -> String -> Bool -> [Package]  Deterministic 
Finds all versions of a package in the global package cache.
findNewestVersion :: GlobalCache -> String -> Maybe Package  Deterministic 
Finds the newest version of a package.
findVersion :: GlobalCache -> String -> (Int,Int,Int,Maybe String) -> Maybe Package  Deterministic 
Finds a specific version of a package.
installedPackageDir :: Config -> Package -> String  Deterministic 
The directory of a package in the global package cache.
packageInstalled :: Config -> Package -> IO Bool  Deterministic 
Checks whether a package is installed in the global cache.
copyPackage :: Config -> Package -> String -> ErrorLogger ()  Deterministic 
Copy a package version to a directory.
acquireAndInstallPackage :: Config -> Package -> ErrorLogger ()  Deterministic 
Acquires a package, either from the global tar file repository or from the source specified in its specification, and installs it to the global package cache.
acquireAndInstallPackageFromSource :: Config -> Package -> ErrorLogger ()  Deterministic 
Acquires a package from the source specified in its specification and installs it to the global package cache.
installFromZip :: Config -> String -> ErrorLogger ()  Deterministic 
Installs a package from a ZIP file to the global package cache.
installMissingDependencies :: Config -> GlobalCache -> [Package] -> ErrorLogger ()  Deterministic 
Installs a package's missing dependencies.
missingPackages :: GlobalCache -> [Package] -> [Package]  Deterministic 
Filters a list of packages to the ones not installed in the global package cache.
checkoutPackage :: Config -> Package -> ErrorLogger ()  Deterministic 
Checkout a package from the global package cache.
uninstallPackage :: Config -> String -> (Int,Int,Int,Maybe String) -> ErrorLogger ()  Deterministic 
Removes a package from the global package cache.
tryFindPackage :: GlobalCache -> String -> (Int,Int,Int,Maybe String) -> ErrorLogger Package  Deterministic 
Tries to find a package in the global package cache.
readGlobalCache :: Config -> Repository -> ErrorLogger GlobalCache  Deterministic 
Reads the global package cache.
readInstalledPackagesFromDir :: Repository -> String -> ErrorLogger (Either String GlobalCache)  Deterministic 
Tries to read package specifications from a GC directory structure.

Exported datatypes:


GlobalCache

The data type representing the global package cache.

Constructors:


Exported operations:

emptyCache :: GlobalCache  Deterministic 

An empty package cache.

Further infos:
  • solution complete, i.e., able to compute all solutions

allPackages :: GlobalCache -> [Package]  Deterministic 

Gets all package specifications from a cache.

Further infos:
  • solution complete, i.e., able to compute all solutions

findAllVersions :: GlobalCache -> String -> Bool -> [Package]  Deterministic 

Finds all versions of a package in the global package cache.

Example call:
(findAllVersions gc p pre)
Parameters:
  • gc : the global package cache
  • p : the name of the package
  • pre : include pre-release versions

findNewestVersion :: GlobalCache -> String -> Maybe Package  Deterministic 

Finds the newest version of a package.

findVersion :: GlobalCache -> String -> (Int,Int,Int,Maybe String) -> Maybe Package  Deterministic 

Finds a specific version of a package.

installedPackageDir :: Config -> Package -> String  Deterministic 

The directory of a package in the global package cache. Does not check whether the package is actually installed!

packageInstalled :: Config -> Package -> IO Bool  Deterministic 

Checks whether a package is installed in the global cache.

copyPackage :: Config -> Package -> String -> ErrorLogger ()  Deterministic 

Copy a package version to a directory.

acquireAndInstallPackage :: Config -> Package -> ErrorLogger ()  Deterministic 

Acquires a package, either from the global tar file repository or from the source specified in its specification, and installs it to the global package cache.

acquireAndInstallPackageFromSource :: Config -> Package -> ErrorLogger ()  Deterministic 

Acquires a package from the source specified in its specification and installs it to the global package cache.

installFromZip :: Config -> String -> ErrorLogger ()  Deterministic 

Installs a package from a ZIP file to the global package cache.

installMissingDependencies :: Config -> GlobalCache -> [Package] -> ErrorLogger ()  Deterministic 

Installs a package's missing dependencies.

missingPackages :: GlobalCache -> [Package] -> [Package]  Deterministic 

Filters a list of packages to the ones not installed in the global package cache.

checkoutPackage :: Config -> Package -> ErrorLogger ()  Deterministic 

Checkout a package from the global package cache.

uninstallPackage :: Config -> String -> (Int,Int,Int,Maybe String) -> ErrorLogger ()  Deterministic 

Removes a package from the global package cache.

tryFindPackage :: GlobalCache -> String -> (Int,Int,Int,Maybe String) -> ErrorLogger Package  Deterministic 

Tries to find a package in the global package cache.

readGlobalCache :: Config -> Repository -> ErrorLogger GlobalCache  Deterministic 

Reads the global package cache.

readInstalledPackagesFromDir :: Repository -> String -> ErrorLogger (Either String GlobalCache)  Deterministic 

Tries to read package specifications from a GC directory structure. If some GC package directory has the same name as a package from the repository index, the package specification from the repository is used, otherwise (this case should not occur) the package specification stored in the directory is read. This should result in faster GC loading.