Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15268 - Allow interactive hooks into ebuilds
Summary: Allow interactive hooks into ebuilds
Status: RESOLVED WORKSFORME
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Highest major
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-07 08:27 UTC by Shevek
Modified: 2011-10-30 22:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shevek 2003-02-07 08:27:45 UTC
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.
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2003-02-21 05:29:00 UTC
-march=pentium3 implies -mcpu=pentium3
Comment 2 SpanKY gentoo-dev 2003-02-25 15:21:40 UTC
why not put a 'bash' line right into the middle of the ebuild