Cabal Bug / Feature and Improvement

Dominic Steinitz dominic.steinitz at blueyonder.co.uk
Wed Dec 24 08:19:55 EST 2008


Currently if I do not want to use the default locations for cabal then the 
following:

>dist\build\cabal\cabal.exe --config-file=urghh --remote-repo-cache=foo 
                            --verbose=3 update

will create urghh but will still (silently) put the repository cache at 

repoLocalDir = "C:\\Documents and Settings\\steinitd\\Application 
Data\\cabal\\packages\\hackage.haskell.org"

I've made a few changes which will put the cache at "foo".  I don't have access 
to darcs at the moment so I've attached the changes. Let me know if a darcs 
patch is worth doing.

Dominic.

In Config.hs:

loadConfig :: Verbosity -> GlobalFlags {-Flag FilePath-} -> Flag Bool -> IO 
SavedConfig
loadConfig verbosity globalFlags {-configFileFlag-} userInstallFlag = 
addBaseConf $ do
  configFile <- maybe defaultConfigFile return (flagToMaybe (globalConfigFile 
globalFlags){-configFileFlag-})

  minp <- readConfigFile mempty configFile
  case minp of
    Nothing -> do
      notice verbosity $ "Config file " ++ configFile ++ " not found."
      notice verbosity $ "Writing default configuration to " ++ configFile
      commentConf <- commentSavedConfig
      initialConf <- initialSavedConfig
      writeConfigFile configFile commentConf (initialConf `mappend` (mempty 
{savedGlobalFlags = globalFlags}))
      return initialConf

The other cases of loadConfig are unchanged.

In Main.hs global replace:

loadConfig verbosity (globalConfigFile globalFlags)

by

loadConfig verbosity globalFlags





More information about the Libraries mailing list