Summary: | sys-apps/portage-2.3.x while re-emerging package postrm is called before postinst | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Stefan Cristian Brindusa <stefan.cristian+gentooforum> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED CANTFIX | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Portage bashrc hook example
Actual postrm before postinst at package re-emerge |
Description
Stefan Cristian Brindusa
2017-12-21 01:07:18 UTC
Created attachment 511278 [details]
Portage bashrc hook example
According to PMS, postrm is supposed to be called before postinst. https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-1120009.2 Created attachment 511280 [details]
Actual postrm before postinst at package re-emerge
@Mike Indeed, that's why I consider it a core bug. Either postrm should not be called before postinst, or a different EBUILD_PHASE can be called in the same /etc/portage/bashrc hook to take its place as the right "post removal hook" i.e. If I have both a postinst and a postrm in the /etc/portage/bashrc, both doing things totally separate from one another, postrm will still be called, even though it's about re-emerging a package. TL;DR: There is a possibility things could get removed without my permission while a re-emerging happens due to the fact that I have a postrm in place. You can probably use some conditional logic based on the REPLACING_VERSIONS and REPLACED_BY_VERSION variables available since EAPI 4: https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-12000011.1.2 We can't change the behavior for current EAPIs, but you can file a "Future EAPI" bug and make it block this tracker: https://bugs.gentoo.org/174380 @Zac Yeah, using REPLACED_* variables helped tremendously. Yet still in the case of re-emerge, I will have to do a separate workaround. Thank you! I will post the blocker against the new EAPI. |