Osamu Aoki wrote:
dpkg-divert(8) seems to be the answer for your case. (But this is not meant for general user but meant for maintanance script). As I understand, removing divert etc has some pitfalls if you are as good as me.
I've been using dpkg-divert for some time already in one case; I guess I know what you mean with the pitfalls, I tried like more than a dozen times until I got it to do what I wanted (spread over several years since I was too lazy to sit down and debug the thing until it worked at once (meaning reinstalling old package versions all the time); this could also mean that dpkg-divert maybe once had bugs when I first tried it, and didn't work just because of that).
Diverting /usr/lib/perl/5.8.8/Encode/Unicode/UTF7.pm would obviously be a 'solution', but that would mean I would risk not getting updates in that particular file. But diverting /usr/bin/dpkg would of course give me a hook (wrapper around dpkg) from both apt and direct calls from other places (like the commandline prompt), and hence be 'better' than your other suggestion:
Another one is dpkg called from apt has hooks. APT.CONF(5)
(I guess you're talking about Pre-Invoke, Post-Invoke, Pre-Install-Pkgs). Does
But wrapping dpkg would mean that I'll have to write a dpkg argument parser; probably not a huge task but maybe still enough work to get right as to question whether it's the right thing to do: too much work to pay off for just this case, but still not giving a solution that would be interesting for the general public, I guess?
Well I'll probably do it and report back here if nothing else pops up. Thanks, Christian.