On Tue, 2023-06-27 at 21:05:57 -0700, Russ Allbery wrote:
> Simon Richter <s...@debian.org> writes:
> > On 6/28/23 02:31, Russ Allbery wrote:
> >> Normally Conflicts is always added with Replaces because otherwise you can
> >> have the following situation:
> 
> >> * Package A version 1.0-1 is installed providing file F.
> >> * File F is moved to package B as of package A 1.0-3.
> >> * User installs package B, which replaces the file in package A.
> >> * User upgrades package A to version 1.0-2 (*not* 1.0-3). Or, rather,
> >>    tries, because this will fail with an error due to the file conflict.
> 
> > No, that is fine. "Replaces: A (<< 1.0-3)" is sufficient here that the
> > file is not unpacked from A 1.0-2.
> 
> Oh!  Of course.  Okay.

Yes, Replaces works regardless of the order. Maybe you had in mind
that this was not always the case, and dpkg could fail to unpack
depending on the order, but that was fixed long long time ago
(dpkg 1.13.x for the general fix and 1.15.x to handle downgrades).

> In that case, I don't actually know why we usually use Conflicts with
> Replaces.  Maybe we don't really need to?

We use Breaks to avoid getting into a situation where neither of the
packages ship the file, which might make things well, break. :)
(And when we do not want to impose a Depends, but instead just force a
versioned constraint on something else.)

Regards,
Guillem

Reply via email to