Control: tag -1 wontfix

On Wed, Jan 25, 2023 at 03:06:03AM +0100, Vincent Lefevre wrote:
> Package: apt
> Version: 2.5.5
> Severity: normal
> 
> "apt-cache rdepends --installed" outputs false positives.
> For instance:
> 
> zira:~> apt-cache rdepends --installed libpcre3:amd64
> libpcre3
> Reverse Depends:
> [...]
>   grep
> [...]
> 
> But according to "dpkg -s grep":
> 
> Depends: dpkg (>= 1.15.4) | install-info
> Pre-Depends: libc6 (>= 2.34), libpcre2-8-0 (>= 10.32)
> 
> there is no libpcre3!
> 
> I'm wondering whether apt is confused by old grep versions
> (which depend on libpcre3, but they are not the currently
> installed version).
> 

You want to use `apt list 
'?any-version(?installed?depends(?exact-name(libpcre3)))'`
instead (with apt >= 2.5.4). In earlier versions you may use:
apt list '?any-version(?archive(now)?depends(?exact-name(libpcre3)))'

The behavior of patterns is better defined than that of the legacy
(r)depends tools. The behavior of rdepends here is not necessarily
useful, but it is the way it is. These commands are provided as-is
and will not receive drastic changes in behavior.

The --installed flag here behaves exactly as it is documented. It
filters the output list by packages that are installed; it doesn't
say anything about restricting matching to installed versions only
- matching always happens on all versions effectively.

The same behavior you can get with patterns by using

`apt list '?installed?depends(?exact-name(libpcre3))'`

For a machine readable output, pass the pattern to apt-cache show.
-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

Reply via email to