Suggesting new method to handle dpkg diversions
I'm CCing debian-devel because many developers might have run into
diversion troubles and might be intrested in this but aren't
subscribed on debian-dpkg. Please reply only there.
Have you ever used dpkg-divert in a package? Ever run into the problem
how to properly remove a diversion on upgrade or remove? In what
script to do it? Limited to which $1 arguments?
To me it seems like diversions are more complicated than they could be
and coupled with the dpkg bug in sarge a nightmare.
What if each package could list all its current diversions in
DEBIAN/diverions (i.e. in the control.tar.gz)? Upon install dpkg would
then add those diversions to its list and removed them on
deinstall. During updates it would add new diversions before unpacking
and remove obsolete diversions after removal of old files.
I think most diversions could be handled this way simplifying the
maintainer scripts and removing the risk of screwing it up. Dpkg would
take care to install/update/remove diversions in the right order and
packages could not leave old diversions behind by mistake.
To implement this there would have to be a way to mark packages as
supporting the DEBIAN/diversions file so dpkg can see if the package
has no diversions or just doesn't follow the new method. I haven't
thought about that part yet.
Thoughts, ideas, comments?
Now tell me I'm nuts.