Bug 226505 - [TRACKER] interactions with postinst phase order change in portage-2.1.5
Bug#: 226505 Product:  Portage Development Version: 2.1 Platform: All
OS/Version: All Status: NEW Severity: normal Priority: P2
Resolution:  Assigned To: dev-portage@gentoo.org Reported By: zmedico@gentoo.org
Component: Conceptual/Abstract Ideas
URL:  http://archives.gentoo.org/gentoo-dev/msg_27feec8fc563e406b174386d24c39fdc.xml
Summary: [TRACKER] interactions with postinst phase order change in portage-2.1.5
Keywords:  Tracker
Status Whiteboard: 
Opened: 2008-06-14 10:23 0000
Description:   Opened: 2008-06-14 10:23 0000
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.