summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2004-12-02 19:39:59 +0000
committerMike Frysinger <vapier@gentoo.org>2004-12-02 19:39:59 +0000
commit02555d166120f7e9105968e8a45098fa40365bdc (patch)
tree7f333b2db131ea2f712b44acb4a305382e181aeb /eclass/toolchain-binutils.eclass
parentCAN-2004-0814 patch updated; adding updated digest. (diff)
downloadhistorical-02555d166120f7e9105968e8a45098fa40365bdc.tar.gz
historical-02555d166120f7e9105968e8a45098fa40365bdc.tar.bz2
historical-02555d166120f7e9105968e8a45098fa40365bdc.zip
make switching of profiles a little smarter
Diffstat (limited to 'eclass/toolchain-binutils.eclass')
-rw-r--r--eclass/toolchain-binutils.eclass19
1 files changed, 17 insertions, 2 deletions
diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
index 75979bd8290a..752b6dd0bddd 100644
--- a/eclass/toolchain-binutils.eclass
+++ b/eclass/toolchain-binutils.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/toolchain-binutils.eclass,v 1.8 2004/12/01 21:29:25 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.9 2004/12/02 19:39:59 vapier Exp $
# We install binutils into CTARGET-VERSION specific directories. This lets
# us easily merge multiple versions for multiple targets (if we wish) and
@@ -9,7 +9,7 @@
inherit eutils libtool flag-o-matic gnuconfig
ECLASS=toolchain-binutils
INHERITED="$INHERITED $ECLASS"
-EXPORT_FUNCTIONS src_unpack src_compile src_test src_install pkg_postinst
+EXPORT_FUNCTIONS src_unpack src_compile src_test src_install pkg_postinst pkg_prerm
export CTARGET="${CTARGET:-${CHOST}}"
@@ -181,5 +181,20 @@ EOF
}
toolchain-binutils_pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${ROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
binutils-config ${CTARGET}-${PV}
}
+
+toolchain-binutils_pkg_prerm() {
+ local curr=$(binutils-config -c)
+ [ "${curr}" != "${CTARGET}-${PV}" ] && return 0
+
+ # if user was so kind as to unmerge the version we have
+ # active, then switch to another version
+ local choice=$(binutils-config -l | grep ${CTARGET} | grep -v ${CTARGET}-${PV})
+ choice=${choice/* }
+ [ -z "${choice}" ] && return 0
+
+ binutils-config ${choice}
+}