Debian Developers - Suggesting new method to handle dpkg diversions

This is Interesting: Free IT Magazines  
Home > Archive > Debian Developers > January 2007 > Suggesting new method to handle dpkg diversions





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Suggesting new method to handle dpkg diversions
Goswin von Brederlow

2007-01-24, 1:17 pm

Hi,

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.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Peter Samuelson

2007-01-25, 7:20 am


[keeping debian-devel CC, this seems to still be relevant]

[Goswin von Brederlow]
> 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.


Sounds to me like a job for a 'dh_diversions' script, and
'debian/packagename.diversions' files in the source package. Or maybe
a 'dh_alternatives' that handles both alternatives and diversions,
since they are similar concepts and alternatives are a great deal more
common.

Presumably slave alternatives would be handled by indenting the slave
line just under its master.

Peter

Mike Hommey

2007-01-25, 7:20 am

On Thu, Jan 25, 2007 at 01:20:47AM -0600, Peter Samuelson <peter@p12n.org> wrote:
>
> [keeping debian-devel CC, this seems to still be relevant]
>
> [Goswin von Brederlow]
>
> Sounds to me like a job for a 'dh_diversions' script, and
> 'debian/packagename.diversions' files in the source package. Or maybe
> a 'dh_alternatives' that handles both alternatives and diversions,
> since they are similar concepts and alternatives are a great deal more
> common.


That wouldn't handle removing (some of) them between 2 versions of a
package. This would be possible with specially crafted .diversions files
but you possibly never get away with old diversions, and bloat the
..diversions files. OTOH, doing it at dpkg level is just simpler from the
maintainer POV.

Mike


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Ian Jackson

2007-01-30, 1:19 pm

Goswin von Brederlow writes ("Suggesting new method to handle dpkg diversions"):
> What if each package could list all its current diversions in
> DEBIAN/diverions (i.e. in the control.tar.gz)?


This is in principle a good idea. It does need thinking about quite
carefully to make sure everything happens just in the right order,
even when errors occur.

> 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.


Indeed.

Ian.


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com