Summary: | Document idempotency requirement for pkg_preinst? (Portage's quickpkg may run pkg_preinst a second time, after already run on live system) | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Sam James <sam> |
Component: | PMS/EAPI | Assignee: | PMS/EAPI <pms> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | dev-portage, flow, gentoo, ionen |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=899648 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Sam James
2023-03-08 04:21:23 UTC
fwiw nvidia-drivers modifies a "${ED}"/etc file so that it gets the current system's GID for the video group (replaces @VIDEOGID@) However I don't want to install that file with @VIDEOGID@ and sed it /after/ in postinst, plus want it to go through etc-update/dispatch-conf rather than modify live system as users could've done a lot with that file So being idempotent would be rather inconvenient here. For the sake of quickpkg, I can at least ensure it won't fail if ran twice, but the GID won't be updated a 2nd time. (In reply to Ionen Wolkens from comment #1) > So being idempotent would be rather inconvenient here. For the sake of > quickpkg, I can at least ensure it won't fail if ran twice, but the GID > won't be updated a 2nd time. By that bit, it also does another check with a temporary uninstalled file that will be missing from the quickpkg (and then `rm || die` will fail). Albeit I can just skip this check if the file is missing. I'd rather keep the spec strict (i.e. the package manager must not run a phase twice), and document this in the devmanual instead. Is there any way to fix quickpkg? Alternatively, indicate in the created binpkg that pkg_preinst and pkg_postinst must not be executed again when installing it? This also affects call order. PMS says that pkg_preinst must be executed before pkg_postinst, but when installing a quickpackaged binpkg, the effective call order is preinst, postinst, preinst, postinst. |