[commit: packages/Cabal] ghc-head: Don't die if some deps weren't reinstalled. (b463558)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:25:03 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=b463558792bc1529d3740c024a0e1bf2ec4b62ad
>---------------------------------------------------------------
commit b463558792bc1529d3740c024a0e1bf2ec4b62ad
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date: Mon May 13 11:29:13 2013 +0200
Don't die if some deps weren't reinstalled.
>---------------------------------------------------------------
b463558792bc1529d3740c024a0e1bf2ec4b62ad
cabal-install/Distribution/Client/Sandbox.hs | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index 8ce48b0..ae73b78 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -76,9 +76,9 @@ import Distribution.Simple.Program ( ProgramConfiguration )
import Distribution.Simple.Setup ( Flag(..)
, fromFlag, fromFlagOrDefault )
import Distribution.Simple.SrcDist ( prepareTree )
-import Distribution.Simple.Utils ( die, debug, notice, info
+import Distribution.Simple.Utils ( die, debug, notice, info, warn
, debugNoWrap, defaultPackageDesc
- , intercalate
+ , intercalate, topHandlerWith
, createDirectoryIfMissingVerbose )
import Distribution.Package ( Package(..) )
import Distribution.System ( Platform )
@@ -476,7 +476,7 @@ reinstallAddSourceDeps :: Verbosity
-> FilePath
-> IO WereDepsReinstalled
reinstallAddSourceDeps verbosity config configFlags' configExFlags
- installFlags globalFlags sandboxDir = do
+ installFlags globalFlags sandboxDir = topHandler' $ do
let configFlags = configFlags'
{ configDistPref = Flag (sandboxBuildDir sandboxDir) }
indexFile <- tryGetIndexFilePath config
@@ -531,6 +531,13 @@ reinstallAddSourceDeps verbosity config configFlags' configExFlags
readIORef retVal
+ where
+ topHandler' = topHandlerWith $ \_ -> do
+ warn verbosity "Couldn't reinstall some add-source dependencies."
+ -- Here we can't know whether any deps have been reinstalled, so we have
+ -- to be conservative.
+ return ReinstalledSomeDeps
+
-- | Check if a sandbox is present and call @reinstallAddSourceDeps@ in that
-- case.
maybeReinstallAddSourceDeps :: Verbosity
More information about the ghc-commits
mailing list