Cabal Bug / Feature and Improvement

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

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

>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 

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.


In Config.hs:

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

  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)


loadConfig verbosity globalFlags

More information about the Libraries mailing list