#1027931 dpkg-dev: dpkg-gencontrol should simplify Depends: foo | bar | foo | baz

#1027931#5
Date:
2023-01-04 18:07:17 UTC
From:
To:
dpkg-gencontrol should also simplify OR(|)-ed lists of alternative
Depends (and friends) by eliminating duplicates.

E.g. after applying ${substvars} and [arch1 arch2] limitations currently
a result could be
  Depends: foo | bar | foo | baz
which should be simplified by eliminating the second 'foo'.
If 'foo' contains version constraints, only entries with identical
version constraints should be considered for elimination.

Defining superseding rules for differing versioned constraints might not
be trivial ...
  foo (>> 2) | foo (>> 1)   supersedes
  foo (>> 1) | foo (>> 2)   does not supersede


Practical examples:
1) nvidia-cuda-toolkit has
  Depends: gcc-${cuda-default-gcc-version} | gcc-11 | gcc-10 | ...
where cuda-default-gcc-version is currently one of {10, 11} and set once
in d/rules.defs (and used in several places)
2) libcuda1/libnvidia-tesla-cuda1 in experimental will soon have
  Recommends: ${nvidia}-kernel-dkms (= ${binary:Version}) | ${nvidia}-kernel-${version} | ${nvidia}-open-kernel-${version} | nvidia-open-kernel-${version}
where ${nvidia} either substitutes 'nvidia' or 'nvidia-tesla' resulting
in a duplicate nvidia-open-kernel-${version} for libcuda1.


Andreas

#1027931#12
Date:
2026-08-02 09:58:25 UTC
From:
To:
Muitos bugs