Re: [pkg-nvidia-devel] Moving diversions between packages
Russ Allbery <firstname.lastname@example.org> writes:
> Goswin von Brederlow <email@example.com> writes:
>> But you are right, if your suggestion is to undo this in prerm then
>> there will be a long delay between undoing and redoing. But if you fully
>> undo things then programs will still start, they just won't be able to
>> use hardware accelerated GL and fallback to software GL.
> No, that's not correct. libGL.so.1 would disappear, which means that any
> programs linked with that shared library would not be able to start at
*fully* undo. That means you delete the link, undo the diversion and
move the original libGL.so.1 back into place. So it would be there. But
as said there is no need to undo the diversion for an upgrade.
>> In prerm you do nothing for "upgrade", remove the diversion+link for
>> "remove" and restore it for "failed-upgrade".
> I'm not seeing why the diversion and link should be manipulated in prerm
> at all rather than in postrm the way that they would be if they were
> managed in preinst. But I could very well be missing something.
- nvidias prerm runs
- nvidias libGL.so.1 is removed by dpkg
- libGL.so.1 is now a dangling symlink
- dpkg still runs and does some bookkeeping and syncing
- nvidias postrm runs
If you remove the diversion in postrm then there is a window where the
link is dangling. The same window existing packages with diversions in
preinst/postrm do have. Removing the diversion in prerm avoids that
window but that only works with your link.
If you remove the diversion in postrm there probably won't be any
complaints but you could do it perfect in prerm.