Debugging ebuilds is very difficult, particularly when there is a task which cannot be scripted (e.g. editing the perl config.sh to make SIGTRTMIN=32 rather than -1). It would be a great advantage if ebuilds had a hook system where they could invoke an interactive subshell in a build directory at various points in the ebuild. This would include standard hooks, such as "pre-configure", "post-configure", etc. ebuild scripts would then contain lines such as call-hook preconfigure which by default would do nothing, but there would be a variable BUILDHOOKS="preconfigure postconfigure preinstall" which would cause those particular hooks to invoke a subshell. Particular ebuilds would implement more hooks than just the standard set, but a standard set would be a good starting point. If the subshell exits with 0, the ebuild would continue as normal. If it exited with a nonzero status, the ebuild would abort. The prompt (PS1) in a subshell would be set to indicate the hook for which the subshell was invoked. This would facilitate: Patching source on the fly. Running extra tests and debugging tests. Modifying the Makefile before build. It would not affect the current ebuild system at all. If no hooks are specified, the ebuild would proceed precisely as it does currently. Currently, I'm discovering that many of my problems are due to gcc miscompiling lots of things when CFLAGS="-march=pentium3 -mcpu=pentium3 -O3" and I want to run valgrind on lots of things halfway through the install.
-march=pentium3 implies -mcpu=pentium3
why not put a 'bash' line right into the middle of the ebuild