Bug#1015794: behaviour of ?archive pattern inconsistent with aptitude
Control: clone -1 -2
Control: retitle -2 ?installed only matches package-level
On Thu, Jul 21, 2022 at 04:03:46PM +0200, Julian Andres Klode wrote:
> Control: severity -1 minor
>
> On Thu, Jul 21, 2022 at 02:36:06PM +0200, Sébastien Villemot wrote:
> > Package: apt
> > Version: 2.5.1
> > Severity: normal
> >
> > Dear Maintainer,
> >
> > I noticed that the ?archive pattern does not behave the same in apt as in
> > aptitude.
>
> That is incorrect.
>
> >
> > My system has both unstable and experimental suites enabled (see below
> > debian.sources).
> >
> > When I run:
> >
> > aptitude versions '~i~Aexperimental'
> >
> > I get a list of those installed package versions that effectively come from
> > experimental (8 in total on my system, in particular I use GCC 12 by default):
> >
> > Package cpp:
> > i A 4:12-20211211-1 experimental 100
> >
> > Package g++:
> > i 4:12-20211211-1 experimental 100
> >
> > …
> >
> > However, when I run:
> >
> > apt list '~i~Aexperimental'
> >
> > I get a list of 297 packages. It seems to include all the installed packages
> > for which a more recent version exists in experimental, independently of
> > whether I installed that more recent version or not. For example, the output
> > contains:
> >
> > wfrench/unstable,now 1.2.6-1 all [installed,automatic]
> >
> > wfrench 1.2.6-1 actually comes from unstable, but there is indeed a 1.2.7-1
> > currently in experimental (which I did not install).
>
> That is correct. What you fail to realize is that apt list lists
> packages, not versions, so it matches like aptitude search, not aptitude
> versions. You'll have to wrap the search in ?any-version if you want
> operations to match against the same version, as in aptitude search.
There actually is one more bug:
jak@jak-t480s:~:master$ aptitude search '?any-version(?installed?archive(kinetic)?name(^apt$))'
jak@jak-t480s:~:master$ apt list '?any-version(?installed?archive(kinetic)?name(^apt$))'
Listing... Done
apt/impish,now 2.5.1+0~202206301128~ubuntu21.10.1 amd64 [installed]
N: There is 1 additional version. Please use the '-a' switch to see it
It's unclear where aptitude implements ?installed for a version, my
impression was it was only implemented by checking if the installed
flag was set at the package level, hence how I implemented it. Sigh.
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Reply to: