summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-04-25 00:26:17 +0000
committerMike Frysinger <vapier@gentoo.org>2006-04-25 00:26:17 +0000
commit87d64b54cbbc214bd7d63f2613e1c7558040b8a5 (patch)
tree8676f63016832582b7dfb2738ec065a3a5012299 /eclass
parentmake sure fix_libtool_files.sh and fixlafiles.awk are never uninstalled #87647 (diff)
downloadgentoo-2-87d64b54cbbc214bd7d63f2613e1c7558040b8a5.tar.gz
gentoo-2-87d64b54cbbc214bd7d63f2613e1c7558040b8a5.tar.bz2
gentoo-2-87d64b54cbbc214bd7d63f2613e1c7558040b8a5.zip
if user uninstalls active toolchain, make sure we switch to a valid one #130772
Diffstat (limited to 'eclass')
-rw-r--r--eclass/toolchain.eclass19
1 files changed, 17 insertions, 2 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index dea08f31c807..997f90856006 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.274 2006/04/25 00:24:47 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.275 2006/04/25 00:26:17 vapier Exp $
HOMEPAGE="http://gcc.gnu.org/"
LICENSE="GPL-2 LGPL-2.1"
@@ -896,6 +896,16 @@ gcc-compiler_pkg_postrm() {
return 0
fi
+ # If user is *uninstalling* the active version, we need to switch to
+ # a different version for them #130772
+ if [[ ! -e ${ROOT}/etc/env.d/${CTARGET}-${GCC_CONFIG_VER} ]] ; then
+ if has_version 'app-admin/eselect-compiler' ; then
+ do_eselect_compiler
+ else
+ do_gcc_config
+ fi
+ fi
+
# ROOT isnt handled by the script
[[ ${ROOT} != "/" ]] && return 0
@@ -2044,7 +2054,12 @@ do_gcc_config() {
use_specs=""
fi
- gcc-config ${CTARGET}-${GCC_CONFIG_VER}${use_specs}
+ current_gcc_config="${CTARGET}-${GCC_CONFIG_VER}${use_specs}"
+ if [[ ! -e ${ROOT}/etc/env.d/gcc/${current_gcc_config} ]] ; then
+ # hrm let's try and pick something better
+ current_gcc_config=$(env -i gcc-config -l | grep ${CTARGET} | awk '{print $NF}' | head -n 1)
+ fi
+ gcc-config ${current_gcc_config}
}
should_we_eselect_compiler() {