[commit: packages/Cabal] ghc-head: Improve the message printed by 'sandbox init'. (5d35566)

git at git.haskell.org git at git.haskell.org
Wed Sep 4 23:58:04 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

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

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

commit 5d35566c68188ad30edb2e9113de4fc83798d4ea
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Fri Aug 30 13:43:52 2013 +0200

    Improve the message printed by 'sandbox init'.


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

5d35566c68188ad30edb2e9113de4fc83798d4ea
 cabal-install/Distribution/Client/Sandbox.hs |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index 5e5e916..6a8854b 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -290,7 +290,6 @@ sandboxInit verbosity sandboxFlags globalFlags = do
   createDirectoryIfMissingVerbose verbosity True sandboxDir'
   sandboxDir <- tryCanonicalizePath sandboxDir'
   setFileHidden sandboxDir
-  notice verbosity $ "Using a sandbox located at " ++ sandboxDir
 
   -- Determine which compiler to use (using the value from ~/.cabal/config).
   userConfig <- loadConfig verbosity (globalConfigFile globalFlags) NoFlag
@@ -304,6 +303,10 @@ sandboxInit verbosity sandboxFlags globalFlags = do
 
   -- Create the index file if it doesn't exist.
   indexFile <- tryGetIndexFilePath (pkgEnvSavedConfig pkgEnv)
+  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





More information about the ghc-commits mailing list