Skip to content

Commit

Permalink
sandbox init: warn instead of dying if there's a cabal-dev sandbox.
Browse files Browse the repository at this point in the history
  • Loading branch information
23Skidoo committed Sep 5, 2013
1 parent 03d12e6 commit c1cc520
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cabal-install/Distribution/Client/Sandbox.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c1cc520

Please sign in to comment.