/[gentoo-x86]/eclass/ghc-package.eclass
Gentoo

Diff of /eclass/ghc-package.eclass

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

Revision 1.29 Revision 1.30
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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/ghc-package.eclass,v 1.29 2011/03/13 20:12:13 slyfox Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.30 2011/05/08 15:00:43 slyfox Exp $
4# 4#
5# @ECLASS: ghc-package.eclass 5# @ECLASS: ghc-package.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# "Gentoo's Haskell Language team" <haskell@gentoo.org> 7# "Gentoo's Haskell Language team" <haskell@gentoo.org>
8# 8#
121 fi 121 fi
122 fi 122 fi
123 return 123 return
124} 124}
125 125
126# @FUNCTION: ghc-supports-shared-libraries
127# @DESCRIPTION:
128# checks if ghc is built with support for building
129# shared libraries (aka '-dynamic' option)
130ghc-supports-shared-libraries() {
131 $(ghc-getghc) --info | grep "RTS ways" | grep -q "dyn"
132}
133
126# @FUNCTION: ghc-extractportageversion 134# @FUNCTION: ghc-extractportageversion
127# @DESCRIPTION: 135# @DESCRIPTION:
128# extract the version of a portage-installed package 136# extract the version of a portage-installed package
129ghc-extractportageversion() { 137ghc-extractportageversion() {
130 local pkg 138 local pkg
280# another package configuration file 288# another package configuration file
281ghc-unregister-pkg() { 289ghc-unregister-pkg() {
282 local localpkgconf 290 local localpkgconf
283 local i 291 local i
284 local pkg 292 local pkg
285 local protected
286 local unregister_flag 293 local unregister_flag
287 localpkgconf="$(ghc-confdir)/$1" 294 localpkgconf="$(ghc-confdir)/$1"
288 295
289 if version_is_at_least "6.4" "$(ghc-version)"; then 296 if version_is_at_least "6.4" "$(ghc-version)"; then
290 unregister_flag="unregister" 297 unregister_flag="unregister"
291 else 298 else
292 unregister_flag="--remove-package" 299 unregister_flag="--remove-package"
293 fi 300 fi
294 301
295 for i in $(ghc-confdir)/*.conf; do
296 [[ "${i}" != "${localpkgconf}" ]] && protected="${protected} $(ghc-listpkg ${i})"
297 done
298 # protected now contains the packages that cannot be unregistered yet
299
300 if [[ -f "${localpkgconf}" ]]; then 302 if [[ -f "${localpkgconf}" ]]; then
301 for pkg in $(ghc-reverse "$(ghc-listpkg ${localpkgconf})"); do 303 for pkg in $(ghc-reverse "$(ghc-listpkg ${localpkgconf})"); do
302 if $(ghc-elem "${pkg}" "${protected}"); then
303 einfo "Package ${pkg} is protected."
304 elif ! ghc-package-exists "${pkg}"; then 304 if ! ghc-package-exists "${pkg}"; then
305 :
306 # einfo "Package ${pkg} is not installed for ghc-$(ghc-version)." 305 einfo "Package ${pkg} is not installed for ghc-$(ghc-version)."
307 else 306 else
308 ebegin "Unregistering ${pkg} " 307 ebegin "Unregistering ${pkg} "
309 $(ghc-getghcpkg) "${unregister_flag}" "${pkg}" --force > /dev/null 308 $(ghc-getghcpkg) "${unregister_flag}" "${pkg}" --force > /dev/null
310 eend $? 309 eend $?
311 fi 310 fi
312 done 311 done
313 fi 312 fi
314} 313}
315 314
316# @FUNCTION: ghc-reverse 315# @FUNCTION: ghc-reverse

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20