[pkg-nvidia-devel] Moving diversions between packages

Goswin von Brederlow goswin-v-b at web.de
Sun Jul 25 17:29:14 UTC 2010

Ian Jackson <ijackson at chiark.greenend.org.uk> writes:

> Goswin von Brederlow writes ("Re: [pkg-nvidia-devel] Moving diversions between packages"):
>> Russ Allbery <rra at debian.org> writes:
>> > Ian Jackson <ijackson at chiark.greenend.org.uk> writes:
>> > > Why not have the new package ship libGL.so.1 to a more specific filename
>> > > and create a symlink named libGL.so.1 by hand in its postinst ?  That
>> > > way you can defer doing the diversion until that part of the postinst,
>> > > by which time the old package and its diversion are gone.
>> >
>> > Oh, huh, I hadn't thought of that.  But wouldn't this cause the library to
>> > temporarily disappear, which would be contrary to the last paragraph of
>> > Policy 8.1?  Am I being too conservative about that?
> Maybe.  The point of policy 8.1 is so that the package can be upgraded
> without rendering all of the things which depend on it unable to
> start.  If you do as I suggest you'll undo the diversion and link in
> the prerm, and thus every time the package is upgraded it will revert
> back to the previous version and (presumably) all the things which are
> linked against it will stop working.
> Does that matter ?

Why should one undo the diversion and link for an upgrade? That only
needs to happen on removal.

>> For the split second between the dpkg-divert and the ln call on install
>> or between the rm and dpkg-divert on removal. I think you are too
>> conservative there.
> No, I don't think that's quite right, for the reasons I give above.
>> You are refering to "between the time that dpkg installs it and the time
>> that ldconfig is run in the postinst script", right? But the disapearing
>> would be only for a split second while your postinst runs.
> It would be better not to have it broken even for a split second -
> after all, something might go wrong and interrupt the process at that
> point.  But I think in my suggestion it will be broken for much
> longer.

Divert without renaming and then overwrite the file with ln -fs. That
should do it atomically or not?

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.

> Perhaps it would be possible to somehow design an arrangement where
> the first time you install the new library package it waits until the
> postinst to do its diversion, but otherwise it leaves it be and
> doesn't mess with the links.
> Ian.

In prerm you do nothing for "upgrade", remove the diversion+link for
"remove" and restore it for "failed-upgrade".

And in postinst you create the diversion+link for "configure" if it does
not exist already.


More information about the Pkg-nvidia-devel mailing list