[commit: Cabal] master: Improve error message when ghc or ghc-pkg are mismatched or not found (ce6fa41)
Ian Lynagh
igloo at earth.li
Fri Jun 24 02:02:12 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/ce6fa414cc1b3a721497a2822cc93f4f76e6e35d
>---------------------------------------------------------------
commit ce6fa414cc1b3a721497a2822cc93f4f76e6e35d
Author: Duncan Coutts <duncan at haskell.org>
Date: Fri Jan 23 16:05:50 2009 +0000
Improve error message when ghc or ghc-pkg are mismatched or not found
>---------------------------------------------------------------
cabal-install/bootstrap.sh | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/cabal-install/bootstrap.sh b/cabal-install/bootstrap.sh
index 8fee1c2..4227fd4 100644
--- a/cabal-install/bootstrap.sh
+++ b/cabal-install/bootstrap.sh
@@ -39,10 +39,14 @@ die () {
grep "cabal-install" ./cabal-install.cabal > /dev/null \
|| die "The bootstrap.sh script must be run in the cabal-install directory"
+${GHC} --numeric-version > /dev/null \
+ || die "${GHC} not found (or could not be run). If ghc is installed make sure it is on your PATH or set the GHC and GHC_PKG vars."
+${GHC_PKG} --version > /dev/null \
+ || die "${GHC_PKG} not found."
GHC_VER=`${GHC} --numeric-version`
GHC_PKG_VER=`${GHC_PKG} --version | cut -d' ' -f 5`
[ ${GHC_VER} = ${GHC_PKG_VER} ] \
- || die "Version mismatch between ${GHC} and ${GHC_PKG}"
+ || die "Version mismatch between ${GHC} and ${GHC_PKG} If you set the GHC variable then set GHC_PKG too"
# Cache the list of packages:
echo "Checking installed packages for ghc-${GHC_VER}..."
More information about the Cvs-libraries
mailing list