Mark bugs as blockers of this bug if they are caused by the changes to ebuild
phase execution order in >=portage-2.1.5. The the order for upgrade and
downgrade operations has changed, but the order for reinstall operations has
not. The new order for upgrades and downgrades is identical to the order used
for reinstall operations:
pkg_preinst
pkg_prerm
pkg_postrm
pkg_postinst
Old versions of portage (less than 2.1.5) used a different order for upgrades
and downgrades:
pkg_preinst
pkg_postinst
pkg_prerm
pkg_postrm
Now that pkg_postinst is called after all other phases, it's not possible to
call has_version in pkg_postinst to detect whether the current install
operation is an upgrade or downgrade. If this information is needed during the
pkg_postinst phase, do the has_version call in an earlier phase (such as
pkg_preinst) and store the result in a global variable to be accessed by
pkg_postinst when it is called.