Use get_libdir instead of hard-coding lib for distcc
authorMatt Turner <mattst88@gentoo.org>
Sat, 25 Jun 2011 17:50:22 +0000 (13:50 -0400)
committerMatt Turner <mattst88@gmail.com>
Sat, 25 Jun 2011 17:50:22 +0000 (13:50 -0400)
ChangeLog
targets/support/chroot-functions.sh

index 30eb83a03ab8a630ca6fc8af63d0991c989138d4..a449e4d3048e81510df8bb3c53306db8888bfbe2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  25 Jun 2011; Matt Turner <mattst88@gentoo.org>
+  targets/support/chroot-functions.sh:
+  Use get_libdir instead of hard-coding lib for distcc
+
   25 Jun 2011; Matt Turner <mattst88@gentoo.org>
   modules/catalyst/arch/mips.py: add multilib (and missing n64) classes
 
index ee605e5aaeeb4f5b29b75f75dd258a0616455e3e..395a91c1f633ad9055c49126f6603e8b51b2b08d 100644 (file)
@@ -92,11 +92,11 @@ setup_myfeatures(){
                # This sets up automatic cross-distcc-fu according to
                # http://www.gentoo.org/doc/en/cross-compiling-distcc.xml
                CHOST=$(portageq envvar CHOST)
-               # TODO: change to use get_libdir
-               cd /usr/lib/distcc/bin
+               LIBDIR=$(get_libdir)
+               cd /usr/${LIBDIR}/distcc/bin
                rm cc gcc g++ c++ 2>/dev/null
-               echo -e '#!/bin/bash\nexec /usr/lib/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
-               chmod a+x /usr/lib/distcc/bin/${CHOST}-wrapper
+               echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
+               chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
                for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
        fi
 
@@ -172,13 +172,13 @@ setup_pkgmgr(){
 }
 
 cleanup_distcc() {
+       LIBDIR=$(get_libdir)
        rm -rf /etc/distcc/hosts
        for i in cc gcc c++ g++; do
-               # TODO: change to use get_libdir
-               rm -f /usr/lib/distcc/bin/${i}
-               ln -s /usr/bin/distcc /usr/lib/distcc/bin/${i}
+               rm -f /usr/${LIBDIR}/distcc/bin/${i}
+               ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
        done
-       rm -f /usr/lib/distcc/bin/*-wrapper
+       rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
 }
 
 cleanup_icecream() {