Le jeudi 21 juillet 2022 à 16:03 +0200, Julian Andres Klode a écrit : > On Thu, Jul 21, 2022 at 02:36:06PM +0200, Sébastien Villemot wrote: > > Package: apt > > Version: 2.5.1 > > Severity: normal > > > > 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. > > The aptitude versions command I believe is the only thing in aptitude that > actually matches versions and is very confusing. Because in your example, if > you used `aptitude install` with your pattern, it would have installed those > same > 297 packages that `apt list` lists.
Thanks for your feedback. I had overlooked the fact that `aptitude versions` behaves in a special way. However `apt list` does not behave as `aptitude search` either on my system: $ apt list '?any-version(~i~Aexperimental)'|wc 297 1430 20645 $ aptitude search '?any-version(~i~Aexperimental)'|wc 8 65 385 Am I still missing something? -- ⢀⣴⠾⠻⢶⣦⠀ Sébastien Villemot ⣾⠁⢠⠒⠀⣿⡁ Debian Developer ⢿⡄⠘⠷⠚⠋⠀ https://sebastien.villemot.name ⠈⠳⣄⠀⠀⠀⠀ https://www.debian.org
signature.asc
Description: This is a digitally signed message part