[Aptitude-devel] Bug#812444: aptitude: REQUEST: operator to version order test in "aptitude search" query syntax.

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Wed Feb 3 11:53:37 UTC 2016

Control: severity -1 wishlist


2016-01-23 20:55 Oleksandr Gavenko:
>I have Debian and Kali origins. Kali based on Debian stable.
>So Kali follow Debian package naming schema but differ in version numbers.
>They also respect Debian version numbering.
>So it is possible to make queries to list difference between Debian and Kali
>with "aptitude search".
>For example to find command packages with same version:
>  $ aptitude search '?narrow(?origin(Kali),?origin(Debian))'
>  ...
>To find packages that in Kali but not in Debian:
>  $ aptitude search '?origin(Kali),!?origin(Debian)'
>  ...
>I would like to find packages that have newer version in Kali than in Debian.
>  https://www.debian.org/doc/manuals/aptitude/ch02s04s05.html
>say nothing about direct version comparing.
>Some indirect comparing possible via ?upgradable and setting priorities in
>debootstrap'ed environment and chrooting and installing packages.
>'?narrow' is equal operator for package version.
>I need a strict greater operator:
>  aptitude search '?gt(?origin(Kali),?origin(Debian))'
>- any package version that greater.
>Origins of my question come from (Russian text):
>  http://permalink.gmane.org/gmane.linux.debian.user.russian/123271

I think that indeed the way to get this list of newer packages Kali than
in Debian is using ?upgradable, if pinning of the repositories (man
apt_preferences) is done correctly and if Kali's versions indeed show
higher numbers than Debian.  Is this not working properly?

Another way to get such a list would be to produce a list of packages
and versions of both Kali an Debian, and post-process it using "dpkg

In general, I don't know if the requested operator is very useful,
because aptitude and apt have different concept of how the system should
work, based on apt pinning.  Packages in Debian experimental or unstable
might have bigger version numbers than the ones in testing or stable,
but still the ones in testing and stable used by default, because the
user prefers to maintain most packages in the stable or testing version.

So "?upgradable" and other terms are more complex carry more meaning
than a simple "greather-than" comparison, and I think that it should be
that way.

And if it's just for that comparison, "dpkg --compare-versions" is the
authoritative source anyway, with its nuances when comparing
alphanumeric strings with symbols.

Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>

More information about the Aptitude-devel mailing list