You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is portage which decides when /etc/portage/bashrc is sourced. Only when it is sourced, the code set up with BashrcdPhase will be executed. So there is nothing which this script can do to change any order.
I do not know whether A can work: variable and function states can be saved on disk between phases, and I doubt that pms gives a guarantee that something is restored for the clean phase. It might work currently, but fail with future portage versions.
I think a clearer version of my question is: does or should portage-bashrc-mv support pre/post-phase hooks as well?
Option A works (see lkraav/portage-git-etc@b786eb1), in theory, but ran into the issue of "register_die_hook() not allowed in global scope"
I couldn't figure out a way to pass variables between phases, so I went with following .setuped etc PMS lockfiles convention, for first attempt. But generates a lot of extra lockfile cleanup concern work, due to clean phase being executed multiple times, and without custom lockfiles, you don't really know which clean phase of the emerge process you're at inside any given execution fo it.
It is strongly looking like implementing PMS native post_pkg_postinst() hook is the way to go here.
Hi. I'm looking to automatically git commit all
/etc
changes, meaning I need to execute as late as possible, probably afterpkg_postinst()
.Many packages, like https://github.com/gentoo-mirror/gentoo/blob/stable/app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild#L52 use
pkg_postinst
phase to run various configuration file change actions.BashrcdPhase postinst
seems to execute its callback before package. Is this intentional?I seem to have 2 options:
A)
BashrcdPhase postinst
set a "reached postinst" flag variable,BashrcdPhase clean
to execute git operationsB) Just use Portage native
post_pkg_postinst()
functionIs option A possible even?
The text was updated successfully, but these errors were encountered: