Copyright | (c) David Himmelstrup 2005 |
---|---|
License | BSD-like |
Maintainer | lemmih@gmail.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Utilities for handling saved state such as known packages, known servers and downloaded packages.
Synopsis
- data SavedConfig = SavedConfig {
- savedGlobalFlags :: GlobalFlags
- savedInitFlags :: InitFlags
- savedInstallFlags :: InstallFlags
- savedClientInstallFlags :: ClientInstallFlags
- savedConfigureFlags :: ConfigFlags
- savedConfigureExFlags :: ConfigExFlags
- savedUserInstallDirs :: InstallDirs (Flag PathTemplate)
- savedGlobalInstallDirs :: InstallDirs (Flag PathTemplate)
- savedUploadFlags :: UploadFlags
- savedReportFlags :: ReportFlags
- savedHaddockFlags :: HaddockFlags
- savedTestFlags :: TestFlags
- savedBenchmarkFlags :: BenchmarkFlags
- savedProjectFlags :: ProjectFlags
- savedReplMulti :: Flag Bool
- loadConfig :: Verbosity -> Flag FilePath -> IO SavedConfig
- getConfigFilePath :: Flag FilePath -> IO FilePath
- showConfig :: SavedConfig -> String
- showConfigWithComments :: SavedConfig -> SavedConfig -> String
- parseConfig :: ConstraintSource -> SavedConfig -> ByteString -> ParseResult SavedConfig
- defaultConfigFile :: IO FilePath
- defaultCacheDir :: IO FilePath
- defaultCacheHome :: IO FilePath
- defaultScriptBuildsDir :: IO FilePath
- defaultStoreDir :: IO FilePath
- defaultCompiler :: CompilerFlavor
- defaultInstallPath :: IO FilePath
- defaultLogsDir :: IO FilePath
- defaultReportsDir :: IO FilePath
- defaultUserInstall :: Bool
- baseSavedConfig :: IO SavedConfig
- commentSavedConfig :: IO SavedConfig
- initialSavedConfig :: IO SavedConfig
- configFieldDescriptions :: ConstraintSource -> [FieldDescr SavedConfig]
- haddockFlagsFields :: [FieldDescr HaddockFlags]
- installDirsFields :: [FieldDescr (InstallDirs (Flag PathTemplate))]
- withProgramsFields :: [FieldDescr [(String, FilePath)]]
- withProgramOptionsFields :: [FieldDescr [(String, [String])]]
- userConfigDiff :: Verbosity -> GlobalFlags -> [String] -> IO [String]
- userConfigUpdate :: Verbosity -> GlobalFlags -> [String] -> IO ()
- createDefaultConfigFile :: Verbosity -> [String] -> FilePath -> IO SavedConfig
- remoteRepoFields :: [FieldDescr RemoteRepo]
- postProcessRepo :: Int -> String -> RemoteRepo -> ParseResult (Either LocalRepo RemoteRepo)
Documentation
data SavedConfig Source #
Instances
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.
showConfig :: SavedConfig -> String Source #
parseConfig :: ConstraintSource -> SavedConfig -> ByteString -> ParseResult SavedConfig Source #
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.
configFieldDescriptions :: ConstraintSource -> [FieldDescr SavedConfig] Source #
All config file fields.
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.
createDefaultConfigFile :: Verbosity -> [String] -> FilePath -> IO SavedConfig Source #
postProcessRepo :: Int -> String -> RemoteRepo -> ParseResult (Either LocalRepo RemoteRepo) Source #