[commit: packages/Cabal] ghc-head: Improve an error message. (aebe581)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:26:08 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=aebe58107e22dad516c18db9681fecca726a4e47

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

commit aebe58107e22dad516c18db9681fecca726a4e47
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Wed May 29 01:16:56 2013 +0200

    Improve an error message.


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

aebe58107e22dad516c18db9681fecca726a4e47
 cabal-install/Distribution/Client/SetupWrapper.hs |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/cabal-install/Distribution/Client/SetupWrapper.hs b/cabal-install/Distribution/Client/SetupWrapper.hs
index 276f7d6..c4cb43b 100644
--- a/cabal-install/Distribution/Client/SetupWrapper.hs
+++ b/cabal-install/Distribution/Client/SetupWrapper.hs
@@ -265,7 +265,8 @@ externalSetupMethod verbosity options pkg bt mkargs = do
     index <- maybeGetInstalledPackages options' comp conf
     let cabalDep = Dependency (PackageName "Cabal") (useCabalVersion options')
     case PackageIndex.lookupDependency index cabalDep of
-      []   -> die $ "The package requires Cabal library version "
+      []   -> die $ "The package '" ++ display (packageName pkg)
+                 ++ "' requires Cabal library version "
                  ++ display (useCabalVersion options)
                  ++ " but no suitable version is installed."
       pkgs -> return $ bestVersion id (map fst pkgs)
@@ -294,7 +295,8 @@ externalSetupMethod verbosity options pkg bt mkargs = do
     index <- maybeGetInstalledPackages options' compiler conf
     let cabalPkgid = PackageIdentifier (PackageName "Cabal") cabalLibVersion
     case PackageIndex.lookupSourcePackageId index cabalPkgid of
-      []           -> die $ "The package requires Cabal library version "
+      []           -> die $ "The package '" ++ display (packageName pkg)
+                      ++ "' requires Cabal library version "
                       ++ display (cabalLibVersion)
                       ++ " but no suitable version is installed."
       iPkgInfos   -> return . Just . installedPackageId





More information about the ghc-commits mailing list