Some packages need further tweaking after emerging an update. For example, every time I update WordPress I need to manually copy all the images I uploaded for various blog entries from the old WordPress tree to the new WordPress tree. Other packages have other repetitive post-install steps. I have suggested to the WordPress maintainers that other users may have the same need - and the suggestion was not adopted. The general problem is fairly easily solved in a simple and elegant manner (IMNSHO :) ) that would work with almost any Gentoo package. Why not introduce support for a user-written ebuild extensions that would run after pkg_postinst? The user would simply create a file called pkg_postinst.ebuild or ebuild.pkg_postinst (or whatever name might make better sense), and that file would be sourced into the ebuild script. This would mean that all of the ebuild variables and functions would be available. In this way a user could 'subclass' an existing ebuild step. One could take this idea a bit further: - allow subclassing most/all of the ebuild steps (pkg_prerm, pkg_setup, src_test, pkg_postrm and pkg_config) - allow the user to place their ebuild extensions in overlays; they could even define an overlay that only contains their ebuild extensions Reproducible: Always
This already exists in /etc/portage/bashrc if you define a function post_pkg_postinst there for example. You can define pre-/posthooks for all phases, you just need to check for $PN yourself if it's supposed to be package-specific.