Merged from trunk -r13180:13184
authorFabian Groffen <grobian@gentoo.org>
Thu, 26 Mar 2009 20:53:23 +0000 (20:53 -0000)
committerFabian Groffen <grobian@gentoo.org>
Thu, 26 Mar 2009 20:53:23 +0000 (20:53 -0000)
   | 13181   | Remove unused tar_opts variable inside unpack(). Thanks to   |
   | zmedico | zong_sharo for reporting.                                    |

   | 13182   | Fix domo and doexe to return non-zero if there are any       |
   | zmedico | errors. Thanks to zong_sharo for reporting.                  |

   | 13183   | Move distcc and ccache PATH setup later, after EAPI is       |
   | zmedico | guaranteed to be known, so that it's possible to do          |
   |         | indepenent EAPI-specific PATH modifications prior to the     |
   |         | distcc/ccache modifications.                                 |

   | 13184   | Source bashrc after PATH tweaks inside ebuild_main().        |
   | zmedico |                                                              |

svn path=/main/branches/prefix/; revision=13195

bin/ebuild-helpers/doexe
bin/ebuild-helpers/domo
bin/ebuild.sh

index 34818ccb11b015f54da527acd77713053963527a..fbbf543d7f3b745ffccfb0b9d798361054bf49cd 100755 (executable)
@@ -14,6 +14,8 @@ if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
        install -d "${ED}${_E_EXEDESTTREE_}"
 fi
 
+ret=0
+
 for x in "$@" ; do
        if [ -L "${x}" ] ; then
                cp "${x}" "${T}"
@@ -24,6 +26,11 @@ for x in "$@" ; do
        else
                mysrc="${x}"
        fi
-       install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_" || \
+       if ! install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_" ; then
                echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
+               false
+       fi
+       ((ret+=$?))
 done
+
+exit $ret
index 2f1295e9c597bdb6a20fb86a0d0c1659fbc15a08..c2a17ced6d7345150054276c0a174f9fb7ed2614 100755 (executable)
@@ -12,6 +12,8 @@ if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
        install -d "${ED}${DESTTREE}/share/locale/"
 fi
 
+ret=0
+
 for x in "$@" ; do
        if [ -e "${x}" ] ; then
                mytiny="${x##*/}"
@@ -22,5 +24,9 @@ for x in "$@" ; do
                install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo"
        else
                echo "!!! ${0##*/}: $x does not exist" 1>&2
+               false
        fi
+       ((ret+=$?))
 done
+
+exit $ret
index e0baf1de9d855e9c171e3ec5038ef00036e8de39..b558ff63277435388f0e407972f5c99995e3aad3 100755 (executable)
@@ -327,7 +327,6 @@ unpack() {
        local x
        local y
        local myfail
-       local tar_opts=""
        local eapi=${EAPI:-0}
        [ -z "$*" ] && die "Nothing passed to the 'unpack' command"
 
@@ -349,7 +348,7 @@ unpack() {
 
                _unpack_tar() {
                        if [ "${y}" == "tar" ]; then
-                               $1 -dc "${srcdir}${x}" | tar xof - ${tar_opts}
+                               $1 -dc "$srcdir$x" | tar xof -
                                assert "$myfail"
                        else
                                $1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
@@ -359,13 +358,13 @@ unpack() {
                myfail="failure unpacking ${x}"
                case "${x##*.}" in
                        tar)
-                               tar xof "${srcdir}${x}" ${tar_opts} || die "$myfail"
+                               tar xof "$srcdir$x" || die "$myfail"
                                ;;
                        tgz)
-                               tar xozf "${srcdir}${x}" ${tar_opts} || die "$myfail"
+                               tar xozf "$srcdir$x" || die "$myfail"
                                ;;
                        tbz|tbz2)
-                               bzip2 -dc "${srcdir}${x}" | tar xof - ${tar_opts}
+                               bzip2 -dc "$srcdir$x" | tar xof -
                                assert "$myfail"
                                ;;
                        ZIP|zip|jar)
@@ -1724,64 +1723,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 "${EPREFIX}"/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="${EPREFIX}/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 "${EPREFIX}"/usr/lib/ccache/bin ]; then
-                       export PATH="${EPREFIX}/usr/lib/ccache/bin:${PATH}"
-               elif [ -d "${EPREFIX}"/usr/bin/ccache ]; then
-                       export PATH="${EPREFIX}/usr/bin/ccache:${PATH}"
-               fi
-
-               [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="${EPREFIX}/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 @PORTAGE_BASE@/bin/functions/*.sh; do
-#              source ${X} || die "Failed to source ${X}"
-#      done
-
-fi # "$*"!="depend" && "$*"!="clean" && "$*" != "setup"
-
 export SANDBOX_ON="1"
 export S=${WORKDIR}/${P}
 
@@ -1954,11 +1895,47 @@ if [ "${EBUILD_PHASE}" != "depend" ] ; then
 fi
 
 ebuild_main() {
-       source_all_bashrcs
        local f x
        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 "${EPREFIX}"/usr/lib/distcc/bin ] ; then
+                               [[ -z ${PATH/*distcc*/} ]] && remove_path_entry distcc
+                               export PATH="${EPREFIX}/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 "${EPREFIX}"/usr/lib/ccache/bin ] ; then
+                               export PATH="${EPREFIX}/usr/lib/ccache/bin:$PATH"
+                       elif [ -d "${EPREFIX}"/usr/bin/ccache ] ; then
+                               export PATH="${EPREFIX}/usr/bin/ccache:$PATH"
+                       fi
+
+                       [[ -z $CCACHE_DIR ]] && export CCACHE_DIR="${EPREFIX}"/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
+
+       source_all_bashrcs
+
        case ${EBUILD_SH_ARGS} in
        nofetch)
                ebuild_phase_with_hooks pkg_nofetch