cabal-install-3.10.2.1: The command-line interface for Cabal and Hackage.

Safe Haskell | None
Language | Haskell2010

Distribution.Client.GlobalFlags

Synopsis

- data GlobalFlags = GlobalFlags {
  - globalVersion :: Flag Bool
  - globalNumericVersion :: Flag Bool
  - globalConfigFile :: Flag FilePath
  - globalConstraintsFile :: Flag FilePath
  - globalRemoteRepos :: NubList RemoteRepo
  - globalCacheDir :: Flag FilePath
  - globalLocalNoIndexRepos :: NubList LocalRepo
  - globalActiveRepos :: Flag ActiveRepos
  - globalLogsDir :: Flag FilePath
  - globalIgnoreExpiry :: Flag Bool
  - globalHttpTransport :: Flag String
  - globalNix :: Flag Bool
  - globalStoreDir :: Flag FilePath
  - globalProgPathExtra :: NubList FilePath
  }
- defaultGlobalFlags :: GlobalFlags
- data RepoContext = RepoContext {
  - repoContextRepos :: [Repo]
  - repoContextGetTransport :: IO HttpTransport
  - repoContextWithSecureRepo :: forall a. Repo -> (forall (down :: Type -> Type). Repository down -> IO a) -> IO a
  - repoContextIgnoreExpiry :: Bool
  }
- withRepoContext :: Verbosity -> GlobalFlags -> (RepoContext -> IO a) -> IO a
- withRepoContext' :: Verbosity -> [RemoteRepo] -> [LocalRepo] -> FilePath -> Maybe String -> Maybe Bool -> [FilePath] -> (RepoContext -> IO a) -> IO a

# Documentation

data GlobalFlags #

Flags that apply at the top level, not to any sub-command.

Constructors

GlobalFlags |

Fields

- globalVersion :: Flag Bool
- globalNumericVersion :: Flag Bool
- globalConfigFile :: Flag FilePath
- globalConstraintsFile :: Flag FilePath
- globalRemoteRepos :: NubList RemoteRepo

  Available Hackage servers.

- globalCacheDir :: Flag FilePath
- globalLocalNoIndexRepos :: NubList LocalRepo
- globalActiveRepos :: Flag ActiveRepos
- globalLogsDir :: Flag FilePath
- globalIgnoreExpiry :: Flag Bool

  Ignore security expiry dates

- globalHttpTransport :: Flag String
- globalNix :: Flag Bool

  Integrate with Nix

- globalStoreDir :: Flag FilePath
- globalProgPathExtra :: NubList FilePath

  Extra program path used for packagedb lookups in a global context (i.e. for http transports)

#### Instances

Instances details

Monoid GlobalFlags # |
Instance details Defined in Distribution.Client.GlobalFlags Methods mempty :: GlobalFlags # mappend :: GlobalFlags -> GlobalFlags -> GlobalFlags # mconcat :: [GlobalFlags] -> GlobalFlags #
Semigroup GlobalFlags # |
Instance details Defined in Distribution.Client.GlobalFlags Methods (<>) :: GlobalFlags -> GlobalFlags -> GlobalFlags # sconcat :: NonEmpty GlobalFlags -> GlobalFlags # stimes :: Integral b => b -> GlobalFlags -> GlobalFlags #
Generic GlobalFlags # |

Instance details

Defined in Distribution.Client.GlobalFlags

Associated Types

type Rep GlobalFlags |

Instance details

Defined in Distribution.Client.GlobalFlags

type Rep GlobalFlags = D1 ('MetaData "GlobalFlags" "Distribution.Client.GlobalFlags" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "GlobalFlags" 'PrefixI 'True) (((S1 ('MetaSel ('Just "globalVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: (S1 ('MetaSel ('Just "globalNumericVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "globalConfigFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)))) :*: ((S1 ('MetaSel ('Just "globalConstraintsFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalRemoteRepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NubList RemoteRepo))) :*: (S1 ('MetaSel ('Just "globalCacheDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalLocalNoIndexRepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NubList LocalRepo))))) :*: ((S1 ('MetaSel ('Just "globalActiveRepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag ActiveRepos)) :*: (S1 ('MetaSel ('Just "globalLogsDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalIgnoreExpiry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)))) :*: ((S1 ('MetaSel ('Just "globalHttpTransport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "globalNix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))) :*: (S1 ('MetaSel ('Just "globalStoreDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalProgPathExtra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NubList FilePath)))))))

Methods

from :: GlobalFlags -> Rep GlobalFlags x #

to :: Rep GlobalFlags x -> GlobalFlags #

Show GlobalFlags # |
Instance details Defined in Distribution.Client.GlobalFlags Methods showsPrec :: Int -> GlobalFlags -> ShowS # show :: GlobalFlags -> String # showList :: [GlobalFlags] -> ShowS #
type Rep GlobalFlags # |

Instance details

Defined in Distribution.Client.GlobalFlags

type Rep GlobalFlags = D1 ('MetaData "GlobalFlags" "Distribution.Client.GlobalFlags" "cabal-install-3.10.2.1-EH6AEtqwlbKE3rh89dIk81" 'False) (C1 ('MetaCons "GlobalFlags" 'PrefixI 'True) (((S1 ('MetaSel ('Just "globalVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: (S1 ('MetaSel ('Just "globalNumericVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)) :*: S1 ('MetaSel ('Just "globalConfigFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)))) :*: ((S1 ('MetaSel ('Just "globalConstraintsFile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalRemoteRepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NubList RemoteRepo))) :*: (S1 ('MetaSel ('Just "globalCacheDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalLocalNoIndexRepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NubList LocalRepo))))) :*: ((S1 ('MetaSel ('Just "globalActiveRepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag ActiveRepos)) :*: (S1 ('MetaSel ('Just "globalLogsDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalIgnoreExpiry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool)))) :*: ((S1 ('MetaSel ('Just "globalHttpTransport") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag String)) :*: S1 ('MetaSel ('Just "globalNix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag Bool))) :*: (S1 ('MetaSel ('Just "globalStoreDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Flag FilePath)) :*: S1 ('MetaSel ('Just "globalProgPathExtra") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NubList FilePath)))))))

defaultGlobalFlags :: GlobalFlags #

data RepoContext #

Access to repositories

Constructors

RepoContext |

Fields

- repoContextRepos :: [Repo]

  All user-specified repositories

- repoContextGetTransport :: IO HttpTransport

  Get the HTTP transport

  The transport will be initialized on the first call to this function.

  NOTE: It is important that we don't eagerly initialize the transport. Initializing the transport is not free, and especially in contexts where we don't know a priori whether or not we need the transport (for instance when using cabal in "nix mode") incurring the overhead of transport initialization on _every_ invocation (eg `cabal build`) is undesirable.

- repoContextWithSecureRepo :: forall a. Repo -> (forall (down :: Type -> Type). Repository down -> IO a) -> IO a

  Get the (initialized) secure repo

  (the `Repo` type itself is stateless and must remain so, because it must be serializable)

- repoContextIgnoreExpiry :: Bool

  Should we ignore expiry times (when checking security)?

withRepoContext :: Verbosity -> GlobalFlags -> (RepoContext -> IO a) -> IO a #

withRepoContext' :: Verbosity -> [RemoteRepo] -> [LocalRepo] -> FilePath -> Maybe String -> Maybe Bool -> [FilePath] -> (RepoContext -> IO a) -> IO a #