On 2024-11-04 18:29, Paride Legovini wrote:
> *However*, if you check the policy table at this point, it will
> identical to the previous one. APT has no way to determine the real
> source of an installed package: it only knows about _versions_ of
> installed packages. [Note how /var/lib/dpkg/status, which contains info
> on the installed packages, has no SHA256 for packages.]
> 
> Not knowing better, APT assumes that that an installed package comes
> from the *first* APT source that provides that version.

APT resorts to this if all the other fields in /var/lib/dpkg/status
do not allow to disambiguate the source of the installed package.
The fields that count are [1]:

  Installed-Size
  Depends
  Pre-Depends
  Conflicts
  Breaks
  Replaces

I tried testing src:gzip from trixie and it worked fine, the
"disambiguating field" being:

+Installed-Size: 246
-Installed-Size: 250

Now, if we can think of a good way to disambiguate any of those
fields before the autopkgtest build, we have a fix for this bug.

Just to verify this is sound, I added a

Conflicts: autopkgtest-disambiguate

to bin:libselinux1 in my local source tree, and this resolved the issue.

Cheers,

Paride

[1] 
https://salsa.debian.org/apt-team/apt/-/blob/bc1fbd12789bfebf225be7af5052840a6add21e2/apt-pkg/deb/deblistparser.cc#L336

Reply via email to