diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-05-04 01:41:49 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-05-04 01:43:37 -0400 |
commit | 2b0ccc8c94bc07934c2f4b66054765003e26ee9f (patch) | |
tree | f7083b47ed2ba1b9ac47b12a41b764d57bb5ffa0 /bin | |
parent | bintree.populate: binhost connection failure triggers TypeError (bug 532784) (diff) | |
download | portage-2b0ccc8c94bc07934c2f4b66054765003e26ee9f.tar.gz portage-2b0ccc8c94bc07934c2f4b66054765003e26ee9f.tar.bz2 portage-2b0ccc8c94bc07934c2f4b66054765003e26ee9f.zip |
emake: refresh comments/docs/style
The comments for this code is woefully out of date. The man page too
has not been updated in a long time to reflect the latest behavior.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ebuild-helpers/emake | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake index 4618053bf..2a3c2f09e 100755 --- a/bin/ebuild-helpers/emake +++ b/bin/ebuild-helpers/emake @@ -1,19 +1,23 @@ #!/bin/bash -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # -# emake: Supplies some default parameters to GNU make. At the moment the -# only parameter supplied is -jN, where N is a number of -# parallel processes that should be ideal for the running host -# (e.g. on a single-CPU machine, N=2). The MAKEOPTS variable -# is set in make.globals. We don't source make.globals -# here because emake is only called from an ebuild. +# emake: Run make and automatically pass along flags set in the env. We support +# MAKEOPTS & EXTRA_EMAKE which allows the user to customize behavior (such as +# parallel builds and load limiting). The latter overrides the ebuild and thus +# should be used with caution (more a debugging knob). +# +# With newer EAPIs, we also automatically fail the build if make itself fails. source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh -if [[ $PORTAGE_QUIET != 1 ]] ; then +cmd=( + ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE} +) + +if [[ ${PORTAGE_QUIET} != 1 ]] ; then ( - for arg in ${MAKE:-make} $MAKEOPTS "$@" $EXTRA_EMAKE ; do + for arg in "${cmd[@]}" ; do [[ ${arg} == *" "* ]] \ && printf "'%s' " "${arg}" \ || printf "%s " "${arg}" @@ -22,7 +26,7 @@ if [[ $PORTAGE_QUIET != 1 ]] ; then ) >&2 fi -${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE} +"${cmd[@]}" ret=$? -[[ $ret -ne 0 ]] && __helpers_die "${0##*/} failed" -exit $ret +[[ ${ret} -ne 0 ]] && __helpers_die "${0##*/} failed" +exit ${ret} |