From: Redjard
Add Hooks to Eselect
For example for "eselect kernel list" the script
/etc/eselect/hooks/kernel/list/pre
is called before the eselect acts, and
/etc/eselect/hooks/kernel/list/post afterwards.
In the functions you can use and modify $params, the value of which the
do
On 2023-08-19 06:58:10, Michał Górny wrote:
You have to provide the rationale here. You can't expect people to sign
up for some shady third-party service to read it.
My bad, not much of value is locked in the proprietary service but I
should have stated as such.
To roughly summarize, I was aski
${function} "${params}"
+ run_hook "${ESELECT_MODULE_NAME}" "${function##do_}" post
else
die "No function ${function}"
fi
}
+# Redjard patch: call hooks
+run_hook() {
+ local action=$1
+ l
t
+ shift; params=("${@}")
if is_function "${function}" ; then
+ run_hook "${ESELECT_MODULE_NAME}" "${function##do_}" pre
- ${function} "$@"
+ ${function} "${params[@]}"
+ run_hook &qu
late external dependencies from all sides, so hooks called from inside
the tool is generally safer for modifying behavior than doing changes
underneath (modifying or wrapping an eselect module) or above (wrapping
the eselect command).
I'm sorry for this having gotten as long as it has
Redjard