This one's pretty straightforward- current ebuild.sh as of .51_pre11 if [ "${EBUILD_PHASE}" == "depend" ]; then function grep() { ..blah... } function gcc() { ..blah.. } fi You get the jist- if during the depend phase, we define QA interceptors. The problem is, that EBUILD_PHASE isn't defined at that point- it's defined *way* down the line. So, unless ebuild.sh DEPEND is ran twice, reusing the exported environment the second time, all of the QA interceptors are *never* used. If this is intentional, might as well remove the interceptors. If not, I suggest using this instead for BIN in java-config python-config gcc perl grep sed python; do src="function ${BIN}() { [ \"\${EBUILD_PHASE}\" == \"depend\" ] && echo \"QA Notice: ${BIN} in global scope: \${CATEGORY}/\$PF\" >&2 local bin_path bin_path=\`type -pf ${BIN}\` if [ \$? != 0 ]; then echo \"missing ${BIN}\" >&2 return 127 else \$bin_path \"\$*\" return \$? fi }"; eval "$src" || die "error creating QA interceptor ${BIN}" done It's mildly ugly, but it centralizes all QA interceptors to one correct definition. As to why I'm explicitly testing the return of type, see bug #54576 ; the current attempt at outputting "blar is missing" is wrong. My definition above does it correctly. Also, note type -pf, rather then type -p. If you defined a function named grep, then performed type -p grep, bash notices the function, and doesn't return anything. This affects portage-2.0.50_pre10/11, and likely extends a bit further back.
doh, never stated the fix for QA interceptors being defined/executed- If you're after getting the QA interceptors turned on just remove the if [ "$EBUILD_PHASE" == "depend" ] check, or move EBUILD_PHASE's definition to the top of ebuild.sh.
pre13's bin interceptor's are still broke. gcc() { [ "$EBUILD_PHASE" == "depend" ] && complain `type -p gcc || echo "missing.gcc"` "$@" } isn't valid. type -p will find the function first, and block the fullpath of gcc from being used. use `type -fp gcc || echo "missing.gcc"` "$@" This still is broke imo; it's not very useful to users if they end up getting bash: missing.gcc: command not found
I re-enable the QA interceptors somewhere around pre14. Either way, they're back on now.