[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: RFC: Idea for improved diversions and alternatives handling

On Sat, Jun 28, 2008 at 02:03:05AM -0700, Steve Langasek wrote:
> So if we allow multiple packages to be installed at the same time which
> divert the same file, then I think we have another case for wanting to
> continue supporting an optional diversion target - or at least for not using
> ".diverted" by default, since we wouldn't want diversions from multiple
> packages to collide.  Maybe ".diverted-$package", then?

I don't think this scenario makes sense outside of transitioning a
diversion from one package to another.

There are two use cases to consider regarding multiple packages and

1) Multiple packages installing a file that has been diverted.
Currently, there is only one "divert to" filename so you'll end up
losing data once the second diverted file is installed.  This could be
alleviated by instead basing the "divert to" filename on the package
which contains the file being diverted (as you suggest above).

There's still the problem of what to do when the package providing the
diversion is uninstalled as now you have conflicting packages.
Actually, you already had conflicting packages that just weren't
affected yet because of the diversion, which leads to 2).

2) Multiple packages diverting the same file.
This currently isn't possible since dpkg-divert will rightly complain
about multiple packages trying to divert the same file.  If it were to
be possible, you would need a layered approach with priorities so
there's a defined notion of which package is currently providing the
contested file and who would do so when that package is removed.  In
this case, congratulations, you've reinvented alternatives.

So it seems like the solution to both of the above scenarios is the use
of alternatives.  There is the problem which brian brought up[0] about
using diversions when you can't rely on having alternatives setup
already but that would be obviated if dpkg internally handled both
diversions and alternatives.

[0] - 20080627172930.GB7523@crustytoothpaste.ath.cx
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan@debian.org>

Attachment: signature.asc
Description: Digital signature

Reply to: