local location
local olocation
local PECLASS
+ local export_funcs_var x
local B_IUSE
local B_DEPEND
# PECLASS is used to restore the ECLASS var after recursion.
PECLASS="$ECLASS"
export ECLASS="$1"
+ export_funcs_var=__export_functions_${ECLASS/-/___}
+ unset $export_funcs_var
if [ "${EBUILD_PHASE}" != "depend" ] && \
[[ ${EBUILD_PHASE} != *rm ]] && \
#turn on glob expansion
set +f
+ if [[ -n ${!export_funcs_var} ]] ; then
+ for x in ${!export_funcs_var} ; do
+ debug-print "EXPORT_FUNCTIONS: $x -> ${ECLASS}_$x"
+ eval "$x() { ${ECLASS}_$x \"\$@\" ; }" > /dev/null
+ done
+ fi
+ unset $export_funcs_var
+
hasq $1 $INHERITED || export INHERITED="$INHERITED $1"
export ECLASS="$PECLASS"
# src_unpack() { base_src_unpack; }
EXPORT_FUNCTIONS() {
if [ -z "$ECLASS" ]; then
- echo "EXPORT_FUNCTIONS without a defined ECLASS" >&2
- exit 1
+ die "EXPORT_FUNCTIONS without a defined ECLASS"
fi
- while [ "$1" ]; do
- debug-print "EXPORT_FUNCTIONS: ${1} -> ${ECLASS}_${1}"
- eval "$1() { ${ECLASS}_$1 \"\$@\" ; }" > /dev/null
- shift
- done
+ eval __export_functions_${ECLASS/-/___}+=\" $*\"
}
# adds all parameters to E_DEPEND and E_RDEPEND, which get added to DEPEND