On Tue, Jun 15, 2010 at 05:55:57PM -0700, Russ Allbery wrote: > One thing that I would like to explain in Policy, but for which I > personally don't know the reason and would like someone else to explain to > me first (*grin*), is why we use Conflicts along with Replaces here. What > happens if one just uses Replaces (with a version stanza) and no > Conflicts? What problem does adding the Conflicts correct? > My understanding of how Replaces works is that, provided that the new > foo-data package contains the same files as were in the foo package, > Replaces will allow it to simply overwrite those files, and there should > be no obvious reason to force an upgrade of the foo package. Am I missing > something subtle, possibly around reinstallations or downgrades of foo? Package: a Version: 1 Package: a Version: 2 Depends: b Package: b Version: 2 Replaces: a (<< 2) This describes a case of a file being moved from package 'a' to package 'b', with the new 'a' depending on 'b'. If you install 'a' version 1, then install 'b' version 2, then /remove/ 'b' version 2, 'a' remains in 'configured' state but is now missing some files because ownership of the files transferred to package 'b'. If Package: b declares Conflicts: a (<< 2) at the same time, this reliably avoids this scenario by forcing an upgrade of 'a'. But it's also overly aggressive, since it forces 'a' version 2 to be unpacked first, *before* unpacking package 'b' - in which case, what do we need the Replaces: for at all? This is really a workaround for the fact that Breaks: didn't exist at the time this part of Policy was written. With Breaks: a (<< 2) and Replaces: a (<< 2), we can force the upgrade of 'a' in tandem with 'b', but without imposing the unpack ordering constraints that cause such big problems for dist-upgrades. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ slangasek@ubuntu.com vorlon@debian.org
Attachment:
signature.asc
Description: Digital signature