diff options
author | Lennart Kolmodin <kolmodin@gentoo.org> | 2009-10-28 23:46:16 +0000 |
---|---|---|
committer | Lennart Kolmodin <kolmodin@gentoo.org> | 2009-10-28 23:46:16 +0000 |
commit | 623aa74e713790a4ae36ca4b120f370268cf87c9 (patch) | |
tree | 623d6d8abf0d1eba1b36ed767ec7e55e30f8f0e6 | |
parent | Install doc files. (diff) | |
download | historical-623aa74e713790a4ae36ca4b120f370268cf87c9.tar.gz historical-623aa74e713790a4ae36ca4b120f370268cf87c9.tar.bz2 historical-623aa74e713790a4ae36ca4b120f370268cf87c9.zip |
Properly support the CABAL_FEATURES="nocabaldep" if user doesn't have dev-haskell/cabal
-rw-r--r-- | eclass/haskell-cabal.eclass | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/eclass/haskell-cabal.eclass b/eclass/haskell-cabal.eclass index 151ca89b6de4..fed53721cd45 100644 --- a/eclass/haskell-cabal.eclass +++ b/eclass/haskell-cabal.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.16 2009/09/09 18:40:11 kolmodin Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.17 2009/10/28 23:46:16 kolmodin Exp $ # # Original authors: Andres Loeh <kosmikus@gentoo.org> # Duncan Coutts <dcoutts@gentoo.org> @@ -113,6 +113,22 @@ cabal-version() { # We're bootstrapping cabal, so the cabal version is the version # of this package itself. _CABAL_VERSION_CACHE="${PV}" + elif [[ "${CABAL_FROM_GHC}" ]]; then + # We can't assume there's a version of Cabal installed by ebuild as + # this might be a first time install of GHC (for packages that + # use the shipped Cabal like haskell-updater). + + # The user is likely to only have one version of Cabal, provided + # by GHC. Note that dev-haskell/cabal can be a dummy package, only + # using the version provided by GHC. If the user has another version + # of Cabal too (more recent than the one GHC provides through + # dev-haskell/cabal, or possibly older if he used an old + # Cabal package) the most recent is used (expected to be the last + # one in the ghc-pkg output). + _CABAL_VERSION_CACHE="$(ghc-pkg field Cabal version | tail -n 1)" + + # Strip out the "version: " prefix + _CABAL_VERSION_CACHE="${_CABAL_VERSION_CACHE#"version: "}" else # We ask portage, not ghc, so that we only pick up # portage-installed cabal versions. |