[commit: packages/Cabal] ghc-head: sandbox init: warn instead of dying if there's a cabal-dev sandbox. (c1cc520)

git at git.haskell.org git at git.haskell.org
Fri Sep 13 17:54:46 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=c1cc5200a05bac1a6c3f29fb2683bbcf5fc4ee43

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

commit c1cc5200a05bac1a6c3f29fb2683bbcf5fc4ee43
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Thu Sep 5 05:49:53 2013 +0200

    sandbox init: warn instead of dying if there's a cabal-dev sandbox.
    
    Fixes #1472.


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

c1cc5200a05bac1a6c3f29fb2683bbcf5fc4ee43
 cabal-install/Distribution/Client/Sandbox.hs |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index fddd139..ff40151 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -275,14 +275,14 @@ dumpPackageEnvironment verbosity _sandboxFlags globalFlags = do
 -- | Entry point for the 'cabal sandbox-init' command.
 sandboxInit :: Verbosity -> SandboxFlags  -> GlobalFlags -> IO ()
 sandboxInit verbosity sandboxFlags globalFlags = do
-  -- Check that there is no 'cabal-dev' directory.
+  -- Warn if there's a 'cabal-dev' sandbox.
   isCabalDevSandbox <- liftM2 (&&) (doesDirectoryExist "cabal-dev")
                        (doesFileExist $ "cabal-dev" </> "cabal.config")
   when isCabalDevSandbox $
-    die $
+    warn verbosity $
     "You are apparently using a legacy (cabal-dev) sandbox. "
-    ++ "To use native cabal sandboxing, please delete the 'cabal-dev' directory "
-    ++  "and run 'cabal sandbox init'."
+    ++ "Legacy sandboxes may interact badly with native Cabal sandboxes. "
+    ++ "You may want to delete the 'cabal-dev' directory to prevent issues."
 
   -- Create the sandbox directory.
   let sandboxDir' = fromFlagOrDefault defaultSandboxLocation




More information about the ghc-commits mailing list