#1061169 aptitude: "aptitude install debhelper-compat" fails with "virtual package provided by: debhelper debhelper debhelper"

Package:
aptitude
Source:
aptitude
Description:
terminal-based package manager
Submitter:
Askar Safin
Date:
2024-01-20 11:27:03 UTC
Severity:
normal
#1061169#5
Date:
2024-01-20 06:30:34 UTC
From:
To:
Steps to reproduce:
- Create fresh sid system
- Type "aptitude install debhelper-compat"

The command will fail with the following absolutely absurd message:

# aptitude install debhelper-compat
"debhelper-compat" is a virtual package provided by:
  debhelper debhelper debhelper debhelper debhelper
You must choose one to install.
Unable to apply some actions, aborting

apt works correctly

#1061169#10
Date:
2024-01-20 11:24:36 UTC
From:
To:
(drive-by comment from an apt maintainer)

debhelper has (currently) five versioned provides. I think aptitude
doesn't support/expect versioned provides here (if at all):
src/cmdline/cmdline_action.cc:278 ff although there are other places
where a similar message is generated in src/pkg_item.cc and
src/gtk/entitysummary.cc.

Would be a good idea to check if a package is already in the pkgvector
before adding it again – or make that vector a set. Note that libapt has
wrappers like APT::PackageSet nowadays which should work better and more
natural than typedef'ed std-containers<pkgCache::PkgIterator>… but that
transition might be a bigger effort than just adding an (untested)
`if (std::ranges::find(possible, j) == possible.end())` before the
push_back.


Best regards

David Kalnischkies