summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-27 04:29:21 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-27 04:29:21 +0000
commit685b1a0787de637ca65f532b7cc09803c8362a02 (patch)
tree414381855ab01a93497810b98794d49ed5400bcb /bin
parentFix domo and doexe to return non-zero if there are any errors. Thanks to (diff)
downloadportage-multirepo-685b1a0787de637ca65f532b7cc09803c8362a02.tar.gz
portage-multirepo-685b1a0787de637ca65f532b7cc09803c8362a02.tar.bz2
portage-multirepo-685b1a0787de637ca65f532b7cc09803c8362a02.zip
Move distcc and ccache PATH setup later, after EAPI is guaranteed to be known,
so that it's possible to do indepenent EAPI-specific PATH modifications prior to the distcc/ccache modifications. (trunk r13183) svn path=/main/branches/2.1.6/; revision=13212
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh93
1 files changed, 35 insertions, 58 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 9ac89174..9ce5be33 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1709,64 +1709,6 @@ preprocess_ebuild_env() {
# === === === === === functions end, main part begins === === === === ===
# === === === === === === === === === === === === === === === === === ===
-if [ -n "${EBUILD_SH_ARGS}" ] && \
- ! hasq ${EBUILD_SH_ARGS} clean depend help info nofetch ; then
-
- if [ "$(id -nu)" == "portage" ] ; then
- export USER=portage
- fi
-
- if hasq distcc ${FEATURES} ; then
- if [ -d /usr/lib/distcc/bin ]; then
- #We can enable distributed compile support
- if [ -z "${PATH/*distcc*/}" ]; then
- # Remove the other reference.
- remove_path_entry "distcc"
- fi
- export PATH="/usr/lib/distcc/bin:${PATH}"
- [ ! -z "${DISTCC_LOG}" ] && addwrite "$(dirname ${DISTCC_LOG})"
- elif which distcc &>/dev/null; then
- if ! hasq distcc $CC; then
- export CC="distcc $CC"
- fi
- if ! hasq distcc $CXX; then
- export CXX="distcc $CXX"
- fi
- fi
- fi
-
- if hasq ccache ${FEATURES} ; then
- #We can enable compiler cache support
- if [ -z "${PATH/*ccache*/}" ]; then
- # Remove the other reference.
- remove_path_entry "ccache"
- fi
-
- if [ -d /usr/lib/ccache/bin ]; then
- export PATH="/usr/lib/ccache/bin:${PATH}"
- elif [ -d /usr/bin/ccache ]; then
- export PATH="/usr/bin/ccache:${PATH}"
- fi
-
- [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="/var/tmp/ccache"
-
- addread "${CCACHE_DIR}"
- addwrite "${CCACHE_DIR}"
-
- [ -n "${CCACHE_SIZE}" ] && ccache -M ${CCACHE_SIZE} &> /dev/null
- else
- # Force configure scripts that automatically detect ccache to respect
- # FEATURES="-ccache"
- export CCACHE_DISABLE=1
- fi
-
- # XXX: Load up the helper functions.
-# for X in /usr/lib/portage/bin/functions/*.sh; do
-# source ${X} || die "Failed to source ${X}"
-# done
-
-fi # "$*"!="depend" && "$*"!="clean" && "$*" != "setup"
-
export SANDBOX_ON="1"
export S=${WORKDIR}/${P}
@@ -1943,6 +1885,41 @@ ebuild_main() {
local export_vars="ASFLAGS CCACHE_DIR CCACHE_SIZE
CFLAGS CXXFLAGS LDFLAGS LIBCFLAGS LIBCXXFLAGS"
+ if ! hasq $EBUILD_SH_ARGS clean depend help info nofetch ; then
+
+ if hasq distcc $FEATURES ; then
+ if [ -d /usr/lib/distcc/bin ] ; then
+ [[ -z ${PATH/*distcc*/} ]] && remove_path_entry distcc
+ export PATH="/usr/lib/distcc/bin:$PATH"
+ [[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
+ elif type -P distcc >/dev/null ; then
+ ! hasq distcc $CC && export CC="distcc $CC"
+ ! hasq distcc $CXX && export CXX="distcc $CXX"
+ fi
+ fi
+
+ if hasq ccache $FEATURES ; then
+ [[ -z ${PATH/*ccache*/} ]] && remove_path_entry ccache
+
+ if [ -d /usr/lib/ccache/bin ] ; then
+ export PATH="/usr/lib/ccache/bin:$PATH"
+ elif [ -d /usr/bin/ccache ] ; then
+ export PATH="/usr/bin/ccache:$PATH"
+ fi
+
+ [[ -z $CCACHE_DIR ]] && export CCACHE_DIR=/var/tmp/ccache
+
+ addread "$CCACHE_DIR"
+ addwrite "$CCACHE_DIR"
+
+ [[ -n $CCACHE_SIZE ]] && ccache -M $CCACHE_SIZE &> /dev/null
+ else
+ # Force configure scripts that automatically detect ccache to
+ # respect FEATURES="-ccache".
+ export CCACHE_DISABLE=1
+ fi
+ fi
+
case ${EBUILD_SH_ARGS} in
nofetch)
ebuild_phase_with_hooks pkg_nofetch