cabal-install-3.10.1.0: The command-line interface for Cabal and Hackage.
Copyright(c) David Himmelstrup 2005
LicenseBSD-like
Maintainerlemmih@gmail.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.Config

Description

Utilities for handling saved state such as known packages, known servers and downloaded packages.

Synopsis

Documentation

data SavedConfig Source #

Instances

Instances details
Monoid SavedConfig Source # 
Instance details

Defined in Distribution.Client.Config

Semigroup SavedConfig Source # 
Instance details

Defined in Distribution.Client.Config

Generic SavedConfig Source # 
Instance details

Defined in Distribution.Client.Config

Associated Types

type Rep SavedConfig :: Type -> Type #

type Rep SavedConfig Source # 
Instance details

Defined in Distribution.Client.Config

type Rep SavedConfig = D1 ('MetaData "SavedConfig" "Distribution.Client.Config" "cabal-install-3.10.1.0-FbhGUvZ0l0XIx7QbOQfSVh" 'False) (C1 ('MetaCons "SavedConfig" 'PrefixI 'True) (((S1 ('MetaSel ('Just "savedGlobalFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GlobalFlags) :*: (S1 ('MetaSel ('Just "savedInitFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InitFlags) :*: S1 ('MetaSel ('Just "savedInstallFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InstallFlags))) :*: ((S1 ('MetaSel ('Just "savedClientInstallFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClientInstallFlags) :*: S1 ('MetaSel ('Just "savedConfigureFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ConfigFlags)) :*: (S1 ('MetaSel ('Just "savedConfigureExFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ConfigExFlags) :*: S1 ('MetaSel ('Just "savedUserInstallDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (InstallDirs (Flag PathTemplate)))))) :*: ((S1 ('MetaSel ('Just "savedGlobalInstallDirs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (InstallDirs (Flag PathTemplate))) :*: (S1 ('MetaSel ('Just "savedUploadFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UploadFlags) :*: S1 ('MetaSel ('Just "savedReportFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ReportFlags))) :*: ((S1 ('MetaSel ('Just "savedHaddockFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HaddockFlags) :*: S1 ('MetaSel ('Just "savedTestFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TestFlags)) :*: (S1 ('MetaSel ('Just "savedBenchmarkFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BenchmarkFlags) :*: S1 ('MetaSel ('Just "savedProjectFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ProjectFlags))))))

loadConfig :: Verbosity -> Flag FilePath -> IO SavedConfig Source #

Loads the main configuration, and applies additional defaults to give the effective configuration. To loads just what is actually in the config file, use loadRawConfig.

getConfigFilePath :: Flag FilePath -> IO FilePath Source #

Returns the config file path, without checking that the file exists. The order of precedence is: input flag, CABAL_CONFIG, default location.

baseSavedConfig :: IO SavedConfig Source #

These are the absolute basic defaults. The fields that must be initialised. When we load the config from the file we layer the loaded values over these ones, so any missing fields in the file take their values from here.

commentSavedConfig :: IO SavedConfig Source #

These are the default values that get used in Cabal if a no value is given. We use these here to include in comments when we write out the initial config file so that the user can see what default value they are overriding.

initialSavedConfig :: IO SavedConfig Source #

This is the initial configuration that we write out to the config file if the file does not exist (or the config we use if the file cannot be read for some other reason). When the config gets loaded it gets layered on top of baseSavedConfig so we do not need to include it into the initial values we save into the config file.

haddockFlagsFields :: [FieldDescr HaddockFlags] Source #

Fields for the haddock section.

installDirsFields :: [FieldDescr (InstallDirs (Flag PathTemplate))] Source #

Fields for the 'install-dirs' sections.

withProgramsFields :: [FieldDescr [(String, FilePath)]] Source #

Fields for the 'program-locations' section.

withProgramOptionsFields :: [FieldDescr [(String, [String])]] Source #

Fields for the 'program-default-options' section.

userConfigDiff :: Verbosity -> GlobalFlags -> [String] -> IO [String] Source #

Get the differences (as a pseudo code diff) between the user's config file and the one that cabal would generate if it didn't exist.

userConfigUpdate :: Verbosity -> GlobalFlags -> [String] -> IO () Source #

Update the user's config file keeping the user's customizations.