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

RFC: Idea for improved diversions and alternatives handling



Hi,

working on dpkg reminded me that I wanted to propose a better
diversion and alternatives handling for debian packages. Currently
they have to be manually added and removed in the maintainer
scripts. This method is prone to errors and can easily leave
diversions or alternatives behind. Instead I suggest creating two new
control files detailing the diversions and alternatives a package
should have.

New control file: diversions
============================

A package wanting to divert files can list them in the control.tar.gz
in a file named "diversions" using the following syntax:

Empty lines and lines starting with # are comments. All other lines
contain:

[dpkg-divert option] ... file

Dpkg will automatically add --package <package> and -add or --remove
before file. If --rename is used without --divert <divert-to> then
--divert <file>.<package> is added as well.

On install dpkg will add all listed diversions before unpacking.
On removal dpkg will remove all listed diversions after deletion.
On updates/downgrades dpkg will add new diversions before unpacking
and remove no longer listed diversions after deletion.

FIXME: what if a line changes? Only allow certain changes?

I think that will cover nearly all diversions from packages.


New control file: alternatives
==============================

A package containing an alternatives can list them in the
control.tar.gz in a file named "alternatives" using the following
syntax:

Empty lines and lines starting with # are comments. All other lines
contain (spaces must be quoted):

genname symlink  altern  priority  [--slave  genname  symlink altern] ...

Dpkg will automatically add alternatives after configuration and
remove them before removal. On updates all settings are updated if
changed.


MfG
        Goswin


Reply to: