[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: naming and relationships of development packages



Hi,

Székelyi Szabolcs <cc@mail.3d.hu> wrote:

> The soversion is usually added to the -dev package name to be able to
> support multiple versions of a library off-line, which means all
> versions can be found in the archive, but only one can be installed on
> the user's machine. The question is, which mechanism should be used to
> accomplish this? Do we need Replaces:? I think Provides and Conflicts is
> enough.

I think it's an analogous case to that of the MTA in Policy, and
therefore, that Replaces should be used. However, I'm not sure whether
any of our current tools (apt, dpkg, etc.) makes any difference if it is
used or not, in this context.

Actually, I tested one case with the apt from unstable:

  apt-get -s install <virtual package>

Having the Replaces in addition to the Provides and Conflicts made no
difference:

foo 1.0-4
~~~~~~~~~
Provides: foo-pkg
Conflicts: foo-pkg

  # apt-get -s install foo-pkg
  Reading package lists... Done
  Building dependency tree... Done
  Note, selecting foo instead of foo-pkg
  The following NEW packages will be installed:
    foo
  0 upgraded, 1 newly installed, 0 to remove and 240 not upgraded.
  Inst foo (1.0-4 Florent Rougon's packages for experiments:unstable)
  Conf foo (1.0-4 Florent Rougon's packages for experiments:unstable)

foo 1.0-5
~~~~~~~~~
Provides: foo-pkg
Conflicts: foo-pkg
Replaces: foo-pkg

  # apt-get -s install foo-pkg
  Reading package lists... Done
  Building dependency tree... Done
  Note, selecting foo instead of foo-pkg
  The following NEW packages will be installed:
    foo
  0 upgraded, 1 newly installed, 0 to remove and 240 not upgraded.
  Inst foo (1.0-5 Florent Rougon's packages for experiments:unstable)
  Conf foo (1.0-5 Florent Rougon's packages for experiments:unstable)


You can check how this situation is handled in the archive with the
following command:

  grep-available -F Provides -s Package,Provides,Replaces,Conflicts \
                 -e ".*-dev" | less

You'll see that many packages use the Replaces, and many don't.
Some even Replace and Conflict with the various -dev packages, but
I don't think it's a good idea (Replacing and Conflicting with the
virtual package should be enough):

  Package: libcupsys2-dev
  Provides: libcupsys-dev
  Replaces: libcupsys1-dev, libcupsys-dev, cupsys (<< 1.1.22-3)
  Conflicts: libcupsys1-dev, libcupsys-dev, cupsys (<< 1.1.22-3)

> I'm not sure I understand the example about MTAs in Policy 7.5.2. Why is
> Replaces needed at all in this particular case? Is this also valid in
> the case of development packages? Why aren't Conflicts + Provides enough?

Quoting § 7.5.2:

  Secondly, Replaces allows the packaging system to resolve which
  package should be removed when there is a conflict

Based on that, I'd argue that the meaning of the Replaces in the MTA
example is:

  Any real package providing mail-transport-agent should be favored upon
  the virtual package mail-transport-agent.

i.e., if something pulls in mail-transport-agent for whatever reason
(e.g., a dependency or 'apt-get install <virtual package>'), then in no
case should the virtual package mail-transport-agent be installed; all
other packages Replacing it are preferred to resolve the situation
(which is fortunate, since of course, you cannot install a virtual
package).

At least, that's the way I understand it.

-- 
Florent



Reply to: