HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulecabal-install-3.12.1.0Haskell2010

Distribution.Client.IndexUtils

Extra utils related to the package indexes.

  • 7 types
  • 18 values
valueindexBaseName :: Repo -> FilePath
#

Get filename base (i.e. without file extension) for index-related files

Secure cabal repositories use a new extended & incremental 01-index.tar. In order to avoid issues resulting from clobbering new/old-style index data, we save them locally to different names.

Example: Use indexBaseName repo . "tar.gz" to compute the FilePath of the 00-index.tar.gz/01-index.tar.gz file.

datadata TotalIndexState
#

Index state of multiple repositories

Instances9Eq, Show, Generic, NFData, Binary, Parsec, …
  • Eq TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • Show TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • Generic TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • NFData TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • Binary TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • Parsec TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
    Example1 expression
    simpleParsec "HEAD" :: Maybe TotalIndexStateJust (TIS IndexStateHead (fromList []))
    Example1 expression
    simpleParsec "" :: Maybe TotalIndexStateNothing
    Example1 expression
    simpleParsec "hackage.haskell.org HEAD" :: Maybe TotalIndexStateJust (TIS IndexStateHead (fromList []))
    Example1 expression
    simpleParsec "2020-02-04T12:34:56Z, hackage.haskell.org HEAD" :: Maybe TotalIndexStateJust (TIS (IndexStateTime (TS 1580819696)) (fromList [(RepoName {unRepoName = "hackage.haskell.org"},IndexStateHead)]))
    Example1 expression
    simpleParsec "hackage.haskell.org 2020-02-04T12:34:56Z" :: Maybe TotalIndexStateJust (TIS IndexStateHead (fromList [(RepoName {unRepoName = "hackage.haskell.org"},IndexStateTime (TS 1580819696))]))
  • Pretty TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • Structured TotalIndexStateDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
  • type Rep TotalIndexState = D1 ('MetaData "TotalIndexState" "Distribution.Client.IndexUtils.IndexState" "cabal-install-3.12.1.0-1D90DH9PPem9Tqn79I9vRN" 'False) (C1 ('MetaCons "TIS" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RepoIndexState) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map RepoName RepoIndexState))))Defined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.IndexState
newtypenewtype ActiveRepos
#

Ordered list of active repositories.

Instances9Eq, Show, Generic, NFData, Binary, Parsec, …
  • Eq ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • Show ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • Generic ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • NFData ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • Binary ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • Parsec ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos

    Note: empty string is not valid ActiveRepos.

    Example1 expression
    simpleParsec "" :: Maybe ActiveReposNothing
    Example1 expression
    simpleParsec ":none" :: Maybe ActiveReposJust (ActiveRepos [])
    Example1 expression
    simpleParsec ":rest" :: Maybe ActiveReposJust (ActiveRepos [ActiveRepoRest CombineStrategyMerge])
    Example1 expression
    simpleParsec "hackage.haskell.org, :rest, head.hackage:override" :: Maybe ActiveReposJust (ActiveRepos [ActiveRepo (RepoName {unRepoName = "hackage.haskell.org"}) CombineStrategyMerge,ActiveRepoRest CombineStrategyMerge,ActiveRepo (RepoName {unRepoName = "head.hackage"}) CombineStrategyOverride])
  • Pretty ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • Structured ActiveReposDefined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
  • type Rep ActiveRepos = D1 ('MetaData "ActiveRepos" "Distribution.Client.IndexUtils.ActiveRepos" "cabal-install-3.12.1.0-1D90DH9PPem9Tqn79I9vRN" 'True) (C1 ('MetaCons "ActiveRepos" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ActiveRepoEntry])))Defined in cabal-install-3.12.1.0 · Distribution.Client.IndexUtils.ActiveRepos
datadata RepoIndexState
#

Specification of the state of a specific repo package index

Constructors

Instances9Eq, Show, Generic, NFData, Binary, Parsec, …
valueparsePackageIndex :: Verbosity -> ByteString -> [IO (Maybe PackageOrDep)]
#

Read 00-index.tar.gz and extract .cabal and preferred-versions files

We read the index using read, which gives us a lazily constructed TarEntries. We translate it to a list of entries using tarEntriesList, which preserves the lazy nature of TarEntries, and finally concatMap a function over this to translate it to a list of IO actions returning PackageOrDeps. We can use lazySequence to turn this into a list of PackageOrDeps, still maintaining the lazy nature of the original tar read.

valueupdateRepoIndexCache :: Verbosity -> Index -> IO ()
#

It is not necessary to call this, as the cache will be updated when the index is read normally. However you can do the work earlier if you like.

Read out the "current" index timestamp, i.e., what timestamp you would use to revert to this version.

Note: this is not the same as readIndexTimestamp! This resolves HEAD to the index's isiHeadTime, i.e. the index latest known timestamp.

Return NoTimestamp if the index has never been updated.

datadata BuildTreeRefType
#

A build tree reference is either a link or a snapshot.

Instances6Eq, Show, Generic, Binary, Structured, Rep

preferred-versions utilities

4 declarations

Expected name of the 'preferred-versions' file.

Contains special constraints, such as a preferred version of a package or deprecations of certain package versions.

Expected format:

binary > 0.9.0.0 || < 0.9.0.0
text == 1.2.1.0

Parser error of the `preferred-versions` file.

Constructors

Instances6Eq, Ord, Read, Show, Generic, Rep