This module contains functions for accessing and modifying the global package cache.
emptyCache
:: GlobalCache
An empty package cache. |
allPackages
:: GlobalCache -> [Package]
Gets all package specifications from a cache. |
findAllVersions
:: GlobalCache -> String -> Bool -> [Package]
Finds all versions of a package in the global package cache. |
findNewestVersion
:: GlobalCache -> String -> Maybe Package
Finds the newest version of a package. |
findVersion
:: GlobalCache -> String -> (Int,Int,Int,Maybe String) -> Maybe Package
Finds a specific version of a package. |
isPackageInstalled
:: GlobalCache -> Package -> Bool
Checks whether a package is installed. |
installedPackageDir
:: Config -> Package -> String
The directory of a package in the global package cache. |
copyPackage
:: Config -> Package -> String -> IO ([LogEntry],Either LogEntry ())
Copy a package version to a directory. |
acquireAndInstallPackage
:: Config -> Package -> IO ([LogEntry],Either LogEntry ())
Acquires a package from the source specified in its specification and installs it to the global package cache. |
installFromZip
:: Config -> String -> IO ([LogEntry],Either LogEntry ())
Installs a package from a ZIP file to the global package cache. |
installMissingDependencies
:: Config -> GlobalCache -> [Package] -> IO ([LogEntry],Either LogEntry ())
Installs a package's missing dependencies. |
missingPackages
:: GlobalCache -> [Package] -> [Package]
Filters a list of packages to the ones not installed in the global package cache. |
checkoutPackage
:: Config -> Repository -> GlobalCache -> Package -> IO ([LogEntry],Either LogEntry ())
Checkout a package from the global package cache. |
uninstallPackage
:: Config -> Repository -> GlobalCache -> String -> (Int,Int,Int,Maybe String) -> IO ([LogEntry],Either LogEntry ())
Removes a package from the global package cache. |
tryFindPackage
:: GlobalCache -> String -> (Int,Int,Int,Maybe String) -> IO ([LogEntry],Either LogEntry Package)
Tries to find a package in the global package cache. |
readInstalledPackagesFromDir
:: Repository -> String -> IO (Either String GlobalCache)
Tries to read package specifications from a GC directory structure. |
The data type representing the global package cache.
Constructors:
An empty package cache.
|
Gets all package specifications from a cache.
|
Finds all versions of a package in the global package cache.
|
Finds the newest version of a package. |
Finds a specific version of a package. |
Checks whether a package is installed. |
The directory of a package in the global package cache. Does not check whether the package is actually installed! |
Copy a package version to a directory. |
Acquires a package from the source specified in its specification and installs it to the global package cache. |
Installs a package from a ZIP file to the global package cache. |
Installs a package's missing dependencies. |
Filters a list of packages to the ones not installed in the global package cache. |
Checkout a package from the global package cache. |
Removes a package from the global package cache. |
Tries to find a package in the global package cache. |
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. |