Re: Rewrite of dpkg-divert to C
Mikhail Gusarov <dottedmag@dottedmag.net> writes:
> This patchset adds testsuite for dpkg-divert which is passed by
> Perl implementation of dpkg-divert and then replaces Perl
> implementation by C implementation which passes the same
> testsuite.
Since you seem to be interested in diversion handling let me bring up
an old idea of mine. Hopefully you will implement this.
I would like diversions (and alternatives actualy) to be handled
automagically by dpkg directly instead of in maintainer scripts. The
handling of diversions is nearly allways the same in all packages and
easy to screw up.
Automagic diversions in dpkg
----------------------------
1) dpkg-divert remains for old packages and cases where the automagic
way is insufficient.
2) new file DEBIAN/diversions
This file lists the diversions of a package, one file per line.
(optionaly 'file new-name'?)
3) dpkg automagic diversion handling
During preinst phase dpkg parses DEBIAN/diversions and runs
dpkg-divert --package <package> --rename --add <file>
for every entry (optionally --divert new-name).
During postrm phase dpkg parses DEBIAN/diversions and runs
dpkg-divert --package <package> --rename --remove <file>
for every entry (optionally --divert new-name).
Similary alternatives should be listed in DEBIAN/alternatives or a
common file and syntax could be used.
MfG
Goswin
PS: "runs dpkg-divert" preferably means does the equivalent directly.
Reply to: