Summary: | sys-apps/portage: File-directory replacement behavior leaves cruft on the filesystem | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Michał Górny <mgorny> |
Component: | Core | Assignee: | Portage team <dev-portage> |
Status: | CONFIRMED --- | ||
Severity: | major | CC: | burcheri.massimo+bugs-gentoo, gentoo, qa |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=326685 https://bugs.gentoo.org/show_bug.cgi?id=286895 https://bugs.gentoo.org/show_bug.cgi?id=668560 https://bugs.gentoo.org/show_bug.cgi?id=834600 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Michał Górny
![]() ![]() ![]() ![]() (In reply to Michał Górny from comment #0) > My suggestion would be to detect this kind of file collisions early, and > fail hard when they happen. I suppose the natural way to resolve it would be a hard blocker? This could lead to difficult situations if critical system packages are involved, since it might not be practical to uninstall them in advance. An alternative might be to have some kind of central registry for things that have to be moved for some reason, kind of like portage's preserve-libs registry. A hard blocker or pkg_preinst() magic, I suppose. Maybe something like this for pkg_preinst() magic: src_install() { emake DESTDIR="${D}" install # Rename directory in ED, in order to bypass collision # protection and handle it manually. mv "${ED}/foo/bar"{,.new} || die } pkg_preinst() { # Remove file in EROOT that the directory collides with. rm -f "${EROOT}/foo/bar" || die # Following the collision protection check, reverse # src_install's rename in ED. mv "${ED}/foo/bar"{.new,} || die } |