Re: dpkg: overwriting file from other package fails despite diversion
On 2012-11-21 11:18 +0100, email@example.com wrote:
> After I made a minimal test package (which worked as expected on all
> systems i tried) I eventually found the problem:
> My package name contained a hyphen ("-"), but in the "preinst" script
> I had used an underscore ("_") instead, so the diversion was created
> (almost) as intended, only for the wrong package ... ;-)
Such PEBKAC happens to all of us once in a while, I guess.
>>> Was there any recent change compared to the policy manual? (I am doing
>>> this on wheezy). Did I get something wrong? To my understanding, this is
>>> pretty exactly the scenario, that is described in the manual ...
>> Also the one used by various Debian packages, so it can be assumed to
>> work in general, or there would have been bug reports.
> just out of curiosity: do you know any examples for this in wheezy?
Here's a list for my system:
| $ LANG=C dpkg-divert --list | grep -v ^local | sed 's/.* by //' | sort -u
> I had tried to find some, but all I could come up with were historic -
> in contemporary packages the preferred method seems to be via
> alternatives ...
One downside with diversions is that it is only possible to divert a
file once, whereas there can be many alternatives. However, switching
from diversions to alternatives requires coordination between packages,
and for essential files like /bin/sh the alternatives system is probably
not quite robust enough.