On Mon, Jan 10, 2022 at 8:19 PM Mike Gilbert <flop...@gentoo.org> wrote: > > On Mon, Jan 10, 2022 at 9:43 AM Michał Górny <mgo...@gentoo.org> wrote: > > > > On Mon, 2022-01-10 at 06:39 +0100, Michał Górny wrote: > > > 4. We could have the eclasses switch to "local" model and rename > > > the .egg-info files somehow at some point. The main question is "rename > > > how?" > > > > > > > If anyone's interested, I've published a proof-of-concept for this: > > > > https://github.com/gentoo/gentoo/pull/23721 > > > > Long story short, the eclass detects if vendored distutils are being > > used and renames the directories from .egg-info to .g.egg-info then. > > This basically means the tag changes from e.g. "py3.8" to "py3.8.g". > > I'm testing this approach now and it doesn't seem to break anything. > > A possible alternative would be to define pkg_preinst in the eclass > and have it move the .egg-info file out of the way before portage > tries to replace it with a directory. That would be a significant API > change for distutils-r1 though.
Portage actually handles installation of a directory over a file by renaming the file with a ".backup.nnnn" suffix. * Installation of a directory is blocked by a file: * '/usr/lib/python3.9/site-packages/layman-2.4.3-py3.9.egg-info' * This file will be renamed to a different name: * '/usr/lib/python3.9/site-packages/layman-2.4.3-py3.9.egg-info.backup.0000' A lazy approach would be to just let Portage do this and advise people to clean them up later if so desired.