Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 142897 - [PATCH] An Emerge hook system
Summary: [PATCH] An Emerge hook system
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Other
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-05 10:18 UTC by David-John Miller
Modified: 2015-06-11 00:42 UTC (History)
3 users (show)

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


Attachments
Patch against emerge-2.1.1_pre4-r2 (emerge_hooks.patch,2.27 KB, patch)
2006-08-05 10:19 UTC, David-John Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David-John Miller 2006-08-05 10:18:37 UTC
With the current state of emerge getting bigger, and better organized, i'm going to propose a hook system into emerge to let users run functions before any build-event in emerge

Currently the proof-of-concept can hook any of the action_* functions in emerge and run any hook-script in /etc/portage/portage.hooks as long as it has a .py extension, which can be further limited to scripts that certify certain conditions, etc.

Also we can modify the tracebacks from any hooked function to hide the emerge system itself, since any error is basically the error of the hook-script writer and not of emerge, although this system is good potential for injection attacks, since any script will be run, allowing modification of portage at runtime

Attached is a patch to emerge-2.1.1_pre4-r2 that will implement this feature

An API of overridable functions in emerge should also be drawn up and users allowed to modify those
Comment 1 David-John Miller 2006-08-05 10:19:25 UTC
Created attachment 93519 [details, diff]
Patch against emerge-2.1.1_pre4-r2
Comment 2 Dan 2006-10-23 20:41:50 UTC
I'd also like to see something like this.

I think simply extending the postsync.d idea that is in recentish portages would be effective.

One possibilite includes:
postmerge.d--Run right before an emerge process terminates, users for this could be glep 42 NEWS updates, removing the etc-update notice from portage itself, running programs such as locale purge once instead of once per package, and perhaps even some of the other commonly run updates (gmime db/env-update comes to mind, but this may break things)
Comment 3 Alex Xu (Hello71) 2015-06-11 00:42:52 UTC
wrt ebuild phases, I believe bashrc can accomplish this.

postmerge.d, just make a shell script.