/[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.7 Revision 1.8
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.7 2005/03/23 13:55:06 kosmikus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.8 2005/04/07 22:00:20 kosmikus Exp $
4# 4#
5# Author: Andres Loeh <kosmikus@gentoo.org> 5# Author: Andres Loeh <kosmikus@gentoo.org>
6# 6#
7# This eclass helps with the Glasgow Haskell Compiler's package 7# This eclass helps with the Glasgow Haskell Compiler's package
8# configuration utility. 8# configuration utility.
111ghc-register-pkg() { 111ghc-register-pkg() {
112 local localpkgconf 112 local localpkgconf
113 localpkgconf="$(ghc-confdir)/$1" 113 localpkgconf="$(ghc-confdir)/$1"
114 if [[ -f ${localpkgconf} ]]; then 114 if [[ -f ${localpkgconf} ]]; then
115 for pkg in $(ghc-listpkg ${localpkgconf}); do 115 for pkg in $(ghc-listpkg ${localpkgconf}); do
116 einfo "Registering ${pkg} ..." 116 ebegin "Registering ${pkg} "
117 $(ghc-getghcpkgbin) -f ${localpkgconf} -s ${pkg} \ 117 $(ghc-getghcpkgbin) -f ${localpkgconf} -s ${pkg} \
118 | $(ghc-getghcpkg) -u --force 118 | $(ghc-getghcpkg) -u --force > /dev/null
119 eend $?
119 done 120 done
120 fi 121 fi
121} 122}
122 123
123# re-adds all available .conf files to the global 124# re-adds all available .conf files to the global
124# package conf file, to be used on a ghc reinstallation 125# package conf file, to be used on a ghc reinstallation
125ghc-reregister() { 126ghc-reregister() {
126 einfo "Re-adding packages ..." 127 einfo "Re-adding packages ..."
127 ewarn "This may cause several warnings, but they should be harmless." 128 einfo "(This may cause several warnings, but they should be harmless.)"
128 if [ -d "$(ghc-confdir)" ]; then 129 if [ -d "$(ghc-confdir)" ]; then
129 pushd $(ghc-confdir) 130 pushd $(ghc-confdir) > /dev/null
130 for conf in *.conf; do 131 for conf in *.conf; do
131 einfo "Processing ${conf} ..." 132 einfo "Processing ${conf} ..."
132 ghc-register-pkg ${conf} 133 ghc-register-pkg ${conf}
133 done 134 done
134 popd 135 popd > /dev/null
135 fi 136 fi
136} 137}
137 138
138# unregisters ... 139# unregisters ...
139ghc-unregister-pkg() { 140ghc-unregister-pkg() {
140 local localpkgconf 141 local localpkgconf
141 localpkgconf="$(ghc-confdir)/$1" 142 localpkgconf="$(ghc-confdir)/$1"
142 if [[ -f ${localpkgconf} ]]; then 143 if [[ -f ${localpkgconf} ]]; then
143 for pkg in $(ghc-reverse "$(ghc-listpkg ${localpkgconf})"); do 144 for pkg in $(ghc-reverse "$(ghc-listpkg ${localpkgconf})"); do
144 einfo "Unregistering ${pkg} ..." 145 ebegin "Unregistering ${pkg} "
145 $(ghc-getghcpkg) -r ${pkg} --force 146 $(ghc-getghcpkg) -r ${pkg} --force > /dev/null
147 eend $?
146 done 148 done
147 fi 149 fi
148} 150}
149 151
150# help-function: reverse a list 152# help-function: reverse a list

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20