hackage-db-2.1.3: Access cabal-install's Hackage database via Data.Map
LicenseBSD3
Maintainersimons@cryp.to
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Hackage.DB.Path

Description

Find the location of the local Hackage database that is maintained by running cabal update.

Synopsis

Documentation

cabalStateDir :: IO FilePath Source #

Determines the state directory (which e.g. holds the hackage tarball) cabal-install uses via the following logic:

  1. If the CABAL_DIR environment variable is set, its content is used as the cabal state directory
  2. If ~/.cabal (see getAppUserDataDirectory) exists, use that.
  3. Otherwise, use ${XDG_CACHE_HOME}/cabal (see getXdgDirectory XdgCache) which is the new directory cabal-install can use starting with version 3.10.*.

This logic is mostly equivalent to what upstream cabal-install is doing with the following exception: The state directory can freely be configured to use a different location in the cabal-install configuration file. hackage-db doesn't parse this configuration file, so differing state directories are ignored.

hackageTarball :: IO FilePath Source #

Determine the default path of the Hackage database, which typically resides in $HOME/.cabal/packages/hackage.haskell.org/. Running the command cabal update or cabal v2-update will keep the index up-to-date.

See cabalStateDir on how hackage-db searches for the cabal state directory.