[commit: packages/Cabal] ghc-head: Better error message. (0cb2017)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:23:18 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=0cb201780a1cbf6a2b3e65e881a90d940092aacf

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

commit 0cb201780a1cbf6a2b3e65e881a90d940092aacf
Author: Mikhail Glushenkov <the.dead.shall.rise at gmail.com>
Date:   Tue Apr 30 17:11:50 2013 +0200

    Better error message.


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

0cb201780a1cbf6a2b3e65e881a90d940092aacf
 cabal-install/Distribution/Client/Sandbox.hs |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/cabal-install/Distribution/Client/Sandbox.hs b/cabal-install/Distribution/Client/Sandbox.hs
index 52eecd1..64c514c 100644
--- a/cabal-install/Distribution/Client/Sandbox.hs
+++ b/cabal-install/Distribution/Client/Sandbox.hs
@@ -55,7 +55,8 @@ import Distribution.Client.Sandbox.PackageEnvironment
   , createPackageEnvironment, classifyPackageEnvironment
   , tryLoadSandboxPackageEnvironment, loadUserConfig
   , commentPackageEnvironment, showPackageEnvironmentWithComments
-  , sandboxPackageEnvironmentFile, updatePackageEnvironment )
+  , sandboxPackageEnvironmentFile, updatePackageEnvironment
+  , userPackageEnvironmentFile )
 import Distribution.Client.Targets            ( UserTarget(..)
                                               , readUserTargets
                                               , resolveUserTargets )
@@ -135,10 +136,14 @@ tryGetIndexFilePath config = do
   let paths = globalLocalRepos . savedGlobalFlags $ config
   case paths of
     []  -> die $ "Distribution.Client.Sandbox.tryGetIndexFilePath: " ++
-           "no local repos found"
+           "no local repos found. " ++ checkConfiguration
     [p] -> return $ p </> Index.defaultIndexFileName
     _   -> die $ "Distribution.Client.Sandbox.tryGetIndexFilePath: " ++
-           "too many local repos found"
+           "too many local repos found. " ++ checkConfiguration
+
+  where
+    checkConfiguration = "Please check your configuration ('"
+                         ++ userPackageEnvironmentFile ++ "')."
 
 -- | Temporarily add $SANDBOX_DIR/bin to $PATH.
 withSandboxBinDirOnSearchPath :: FilePath -> IO a -> IO a





More information about the ghc-commits mailing list