Repository : ssh://[email protected]/Cabal

On branch  : ghc-head
Link       : 
http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=0cdff42ec4c51b58856e14bfc62d20ca096b6c7c

>---------------------------------------------------------------

commit 0cdff42ec4c51b58856e14bfc62d20ca096b6c7c
Author: Mikhail Glushenkov <[email protected]>
Date:   Fri Aug 30 14:42:46 2013 +0200

    Create a package DB for the default compiler in 'sandbox init'.
    
    Fixes #1450.


>---------------------------------------------------------------

0cdff42ec4c51b58856e14bfc62d20ca096b6c7c
 cabal-install/Distribution/Client/Sandbox.hs |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/cabal-install/Distribution/Client/Sandbox.hs 
b/cabal-install/Distribution/Client/Sandbox.hs
index 6a8854b..fddd139 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -293,26 +293,28 @@ sandboxInit verbosity sandboxFlags globalFlags = do
 
   -- Determine which compiler to use (using the value from ~/.cabal/config).
   userConfig <- loadConfig verbosity (globalConfigFile globalFlags) NoFlag
-  (comp, platform, _) <- configCompilerAuxEx (savedConfigureFlags userConfig)
+  (comp, platform, conf) <- configCompilerAuxEx (savedConfigureFlags 
userConfig)
 
   -- Create the package environment file.
   pkgEnvFile <- getSandboxConfigFilePath globalFlags
   createPackageEnvironmentFile verbosity sandboxDir pkgEnvFile
     NoComments comp platform
-  (_, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
+  (_sandboxDir, pkgEnv) <- tryLoadSandboxConfig verbosity globalFlags
+  let config      = pkgEnvSavedConfig pkgEnv
+      configFlags = savedConfigureFlags config
 
   -- Create the index file if it doesn't exist.
-  indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)
+  indexFile <- tryGetIndexFilePath config
   indexFileExists <- doesFileExist indexFile
   if indexFileExists
     then notice verbosity $ "Using an existing sandbox located at " ++ 
sandboxDir
     else notice verbosity $ "Creating a new sandbox at " ++ sandboxDir
   Index.createEmpty verbosity indexFile
 
-  -- We don't create the package DB for the default compiler here: it's created
-  -- by demand in 'install' and 'configure'. This way, if you run 'sandbox 
init'
-  -- and then 'configure -w /path/to/nondefault-ghc', you'll end up with a
-  -- package DB for only one compiler instead of two.
+  -- Create the package DB for the default compiler.
+  initPackageDBIfNeeded verbosity configFlags comp conf
+  maybeAddCompilerTimestampRecord verbosity sandboxDir indexFile
+    (compilerId comp) platform
 
 -- | Entry point for the 'cabal sandbox-delete' command.
 sandboxDelete :: Verbosity -> SandboxFlags -> GlobalFlags -> IO ()


_______________________________________________
ghc-commits mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/ghc-commits

Reply via email to