Hi,

On Sat, Apr 25, 2020 at 12:56:48AM +0200, Lorenzo wrote:
> I have a question:
> let's say that I change the recommends, like the following
>
> Recommends: runit-systemd | runit-sysv | runit-init
>
> What happens in a given system if the "runit-systemd" package is not
> in the apt index (the package is not in the repository)?

apt will ignore an or-group member if the candidate version is not able
to satisfy the dependency and look at the next one – as an unknown
package has no candidate, it is ignored. The same is true for a known
package which is pinned to a negative value. Or if the dependency is
versioned (>= 2) but the candidate is only version 1.


> What happens if the 'runit-systemd' package exists, but one of its
> dependency, like, for instance, 'systemd-sysv' does not exists in
> the repository?

Short answer: Strange things.

Currently apt will see that the first or-group member is itself
a satisfier and hence will try to install it. That this will not work
out is realized too late to do anything about it. The Recommends will
hence not be satisfied at all! (which is not an error as Recommends are
not *required*, but apt should of course try a little harder…)

That is a rabbit hole I went into for the weekend [0], so in the future
apt should be behaving better here noticing earlier that dependencies of
the or-group member will not be satisfiable and look at the others just
like in the first question – aka: "apt will work as expected™".


> I'm asking because there are downstreams (like Devuan) that blacklist
> systemd packages in their archive

If they are rebuilding packages it might make sense to change the order
of the or-group based on for which distribution you are building for.
See dpkg-vendor and deb-substvars. In apt we are e.g. using this to
depend on the correct -archive-keyring package for the distribution we
are built for, there are probably easier/better examples though.


Best regards

David Kalnischkies

[0] https://salsa.debian.org/apt-team/apt/-/merge_requests/117

Attachment: signature.asc
Description: PGP signature

Reply via email to