#1030643 aptitude: buggy handling of "Provides:" when trying to remove a package

Package:
aptitude
Source:
aptitude
Description:
terminal-based package manager
Submitter:
Vincent Lefevre
Date:
2023-02-06 03:00:04 UTC
Severity:
normal
#1030643#5
Date:
2023-02-06 02:56:47 UTC
From:
To:
When I want to remove the libldap2-dev transitional package from the
command line, I get:

cventin:~> aptitude remove -s libldap2-dev
The following packages will be REMOVED:
  libldap-dev{u} libldap2-dev
0 packages upgraded, 0 newly installed, 2 to remove and 27 not upgraded.
Need to get 0 B of archives. After unpacking 1655 kB will be freed.
The following packages have unmet dependencies:
 libaprutil1-dev : Depends: libldap2-dev but it is not going to be installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libldap-dev [2.5.13+dfsg-3 (now, testing, unstable)]

It appears that aptitude wants to remove libldap-dev too soon,
as this will break the dependencies: libaprutil1-dev depends on
libldap2-dev, which is provided by libldap-dev.

The other proposed solutions are not OK as they want to install or
remove other packages.

And from the TUI, if I type '-' on libldap2-dev, I get:

libldap2-dev (remove, 2.5.13+dfsg-3) will be removed.                          ▒
                                                                               ▒
The following packages depend on libldap2-dev (remove, 2.5.13+dfsg-3) and will ▒
be broken by its removal:                                                      ▒
                                                                               ▒
  * libaprutil1-dev (held/unchanged, 1.6.3-1) depends on libldap2-dev (provided▒
    by libldap-dev 2.5.13+dfsg-3)                                              ▒

This is incorrect too, and the message is even buggy, as it correctly
says that libldap2-dev is provided by libldap-dev, but I'm not asking
to remove libldap-dev. So this doesn't make sense.