summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-04-02 09:14:56 +0000
committerMike Frysinger <vapier@gentoo.org>2006-04-02 09:14:56 +0000
commit5cf4661ac0ddb38930d774304267dc931cdf1e3b (patch)
tree7a985a1abcb24dbd15918b18f81755e8f352838e /eclass/toolchain.eclass
parentadd some more error checking when installing files (diff)
downloadgentoo-2-5cf4661ac0ddb38930d774304267dc931cdf1e3b.tar.gz
gentoo-2-5cf4661ac0ddb38930d774304267dc931cdf1e3b.tar.bz2
gentoo-2-5cf4661ac0ddb38930d774304267dc931cdf1e3b.zip
fix gcc_movelibs() multilib installs by delying the removal of dirs until the very end so that things dont break when using relative paths that involve dirs we removed
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass15
1 files changed, 12 insertions, 3 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 47931cc70eb2..3518562ba381 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.259 2006/04/02 09:13:46 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.260 2006/04/02 09:14:56 vapier Exp $
HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html"
LICENSE="GPL-2 LGPL-2.1"
@@ -1647,7 +1647,7 @@ gcc-compiler_src_install() {
# when installing gcc, it dumps internal libraries into /usr/lib
# instead of the private gcc lib path
gcc_movelibs() {
- local multiarg
+ local multiarg removedirs=""
for multiarg in $($(XGCC) -print-multi-lib) ; do
multiarg=${multiarg#*;}
multiarg=${multiarg//@/ -}
@@ -1666,17 +1666,26 @@ gcc_movelibs() {
${PREFIX}/${CTARGET}/lib/${OS_MULTIDIR} \
${PREFIX}/lib/${MULTIDIR}
do
+ removedirs="${removedirs} ${FROMDIR}"
FROMDIR=${D}${FROMDIR}
if [[ ${FROMDIR} != "${TODIR}" && -d ${FROMDIR} ]] ; then
local files=$(find "${FROMDIR}" -maxdepth 1 ! -type d 2>/dev/null)
if [[ -n ${files} ]] ; then
mv ${files} "${TODIR}"
fi
- rmdir "${FROMDIR}" 2>/dev/null
fi
done
done
+ # We remove directories separately to avoid this case:
+ # mv SRC/lib/../lib/*.o DEST
+ # rmdir SRC/lib/../lib/
+ # mv SRC/lib/../lib32/*.o DEST # Bork
+ for FROMDIR in ${removedirs} ; do
+ rmdir "${D}"${FROMDIR} >& /dev/null
+ done
+ find "${D}" -type d | xargs rmdir >& /dev/null
+
# make sure the libtool archives have libdir set to where they actually
# -are-, and not where they -used- to be.
fix_libtool_libdir_paths "$(find ${D}${LIBPATH} -name *.la)"