diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-12-09 02:42:38 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-12-09 02:42:38 +0000 |
commit | 6ab8a11b145aeb1a18bcc39dacaf702f6132997e (patch) | |
tree | 00f8c95ae2db18df99338959c6bfac6b475c98d1 /eclass/toolchain-binutils.eclass | |
parent | manifest (Manifest recommit) (diff) | |
download | gentoo-2-6ab8a11b145aeb1a18bcc39dacaf702f6132997e.tar.gz gentoo-2-6ab8a11b145aeb1a18bcc39dacaf702f6132997e.tar.bz2 gentoo-2-6ab8a11b145aeb1a18bcc39dacaf702f6132997e.zip |
let binutils-config generate symlinks and clean up after uninstalls better
Diffstat (limited to 'eclass/toolchain-binutils.eclass')
-rw-r--r-- | eclass/toolchain-binutils.eclass | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass index cf3fa23ccb29..a5dd5045a9d7 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.13 2004/12/07 00:49:25 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain-binutils.eclass,v 1.14 2004/12/09 02:42:38 vapier Exp $ # We install binutils into CTARGET-VERSION specific directories. This lets # us easily merge multiple versions for multiple targets (if we wish) and @@ -39,7 +39,7 @@ fi DEPEND="virtual/libc nls? ( sys-devel/gettext ) - sys-devel/binutils-config + >=sys-devel/binutils-config-1.1 !build? ( !bootstrap? ( dev-lang/perl ) )" LIBPATH="/usr/lib/binutils/${CTARGET}/${PV}" @@ -153,16 +153,7 @@ toolchain-binutils_src_install() { mv "${D}"/${LIBPATH}/lib/* "${D}"/${LIBPATH}/ rm -r "${D}"/${LIBPATH}/lib fi - - # Now we generate all the standard links to binaries ... - # if this is a native package, we install the basic symlinks (ld,nm,as,etc...) - # in addition to the ${CTARGET}-{ld,nm,as,etc...} symlinks - cd "${D}"/${BINPATH} - dodir /usr/bin - for x in * ; do - dosym ../${CTARGET}/bin/${x} /usr/bin/${CTARGET}-${x} - is_cross || dosym ${CTARGET}-${x} /usr/bin/${x} - done + dodir /usr/${CTARGET}/{bin,include,lib} # Generate an env.d entry for this binutils cd ${S} @@ -201,14 +192,19 @@ toolchain-binutils_pkg_postinst() { } toolchain-binutils_pkg_prerm() { - local curr=$(binutils-config -c) - [ "${curr}" != "${CTARGET}-${PV}" ] && return 0 + local curr=$(env CHOST=${CTARGET} 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} + # If no other versions exist, then uninstall for this + # target ... otherwise, switch to the newest version + if [[ -z ${choice} ]] ; then + binutils-config -u ${CTARGET} + else + binutils-config ${choice} + fi } |