summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorAndres Loeh <kosmikus@gentoo.org>2005-03-23 13:55:06 +0000
committerAndres Loeh <kosmikus@gentoo.org>2005-03-23 13:55:06 +0000
commitc72b5cdaf3d5c8136898a199c7b357b387366919 (patch)
tree6b3a0b7e4ad9fb38f627b6402bb0689c525fac0a /eclass
parentversion bump (diff)
downloadgentoo-2-c72b5cdaf3d5c8136898a199c7b357b387366919.tar.gz
gentoo-2-c72b5cdaf3d5c8136898a199c7b357b387366919.tar.bz2
gentoo-2-c72b5cdaf3d5c8136898a199c7b357b387366919.zip
make ghc-package work correctly with ebuilds that don't add own packages
give ghc binary distributions in /opt/ghc/bin higher priority than /usr/local
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ghc-package.eclass27
1 files changed, 16 insertions, 11 deletions
diff --git a/eclass/ghc-package.eclass b/eclass/ghc-package.eclass
index dee796aa01f2..6c4a5b4bc463 100644
--- a/eclass/ghc-package.eclass
+++ b/eclass/ghc-package.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.6 2005/03/18 23:31:48 kosmikus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ghc-package.eclass,v 1.7 2005/03/23 13:55:06 kosmikus Exp $
#
# Author: Andres Loeh <kosmikus@gentoo.org>
#
@@ -12,7 +12,8 @@ inherit versionator
ECLASS="ghc-package"
INHERITED="${INHERITED} ${ECLASS}"
-PATH="${PATH}:/opt/ghc/bin"
+# promote /opt/ghc/bin to a better position in the search path
+PATH="/usr/bin:/opt/ghc/bin:${PATH}"
# for later configuration using environment variables/
# returns the name of the ghc executable
@@ -110,11 +111,13 @@ ghc-install-pkg() {
ghc-register-pkg() {
local localpkgconf
localpkgconf="$(ghc-confdir)/$1"
- for pkg in $(ghc-listpkg ${localpkgconf}); do
- einfo "Registering ${pkg} ..."
- $(ghc-getghcpkgbin) -f ${localpkgconf} -s ${pkg} \
- | $(ghc-getghcpkg) -u --force
- done
+ if [[ -f ${localpkgconf} ]]; then
+ for pkg in $(ghc-listpkg ${localpkgconf}); do
+ einfo "Registering ${pkg} ..."
+ $(ghc-getghcpkgbin) -f ${localpkgconf} -s ${pkg} \
+ | $(ghc-getghcpkg) -u --force
+ done
+ fi
}
# re-adds all available .conf files to the global
@@ -136,10 +139,12 @@ ghc-reregister() {
ghc-unregister-pkg() {
local localpkgconf
localpkgconf="$(ghc-confdir)/$1"
- for pkg in $(ghc-reverse "$(ghc-listpkg ${localpkgconf})"); do
- einfo "Unregistering ${pkg} ..."
- $(ghc-getghcpkg) -r ${pkg} --force
- done
+ if [[ -f ${localpkgconf} ]]; then
+ for pkg in $(ghc-reverse "$(ghc-listpkg ${localpkgconf})"); do
+ einfo "Unregistering ${pkg} ..."
+ $(ghc-getghcpkg) -r ${pkg} --force
+ done
+ fi
}
# help-function: reverse a list