/[gentoo-x86]/eclass/haskell-cabal.eclass
Gentoo

Diff of /eclass/haskell-cabal.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.16 Revision 1.17
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.16 2009/09/09 18:40:11 kolmodin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/haskell-cabal.eclass,v 1.17 2009/10/28 23:46:16 kolmodin Exp $
4# 4#
5# Original authors: Andres Loeh <kosmikus@gentoo.org> 5# Original authors: Andres Loeh <kosmikus@gentoo.org>
6# Duncan Coutts <dcoutts@gentoo.org> 6# Duncan Coutts <dcoutts@gentoo.org>
7# Maintained by: Haskell herd <haskell@gentoo.org> 7# Maintained by: Haskell herd <haskell@gentoo.org>
8# 8#
111 if [[ -z "${_CABAL_VERSION_CACHE}" ]]; then 111 if [[ -z "${_CABAL_VERSION_CACHE}" ]]; then
112 if [[ "${CABAL_BOOTSTRAP}" ]]; then 112 if [[ "${CABAL_BOOTSTRAP}" ]]; then
113 # We're bootstrapping cabal, so the cabal version is the version 113 # We're bootstrapping cabal, so the cabal version is the version
114 # of this package itself. 114 # of this package itself.
115 _CABAL_VERSION_CACHE="${PV}" 115 _CABAL_VERSION_CACHE="${PV}"
116 elif [[ "${CABAL_FROM_GHC}" ]]; then
117 # We can't assume there's a version of Cabal installed by ebuild as
118 # this might be a first time install of GHC (for packages that
119 # use the shipped Cabal like haskell-updater).
120
121 # The user is likely to only have one version of Cabal, provided
122 # by GHC. Note that dev-haskell/cabal can be a dummy package, only
123 # using the version provided by GHC. If the user has another version
124 # of Cabal too (more recent than the one GHC provides through
125 # dev-haskell/cabal, or possibly older if he used an old
126 # Cabal package) the most recent is used (expected to be the last
127 # one in the ghc-pkg output).
128 _CABAL_VERSION_CACHE="$(ghc-pkg field Cabal version | tail -n 1)"
129
130 # Strip out the "version: " prefix
131 _CABAL_VERSION_CACHE="${_CABAL_VERSION_CACHE#"version: "}"
116 else 132 else
117 # We ask portage, not ghc, so that we only pick up 133 # We ask portage, not ghc, so that we only pick up
118 # portage-installed cabal versions. 134 # portage-installed cabal versions.
119 _CABAL_VERSION_CACHE="$(ghc-extractportageversion dev-haskell/cabal)" 135 _CABAL_VERSION_CACHE="$(ghc-extractportageversion dev-haskell/cabal)"
120 fi 136 fi

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20