[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#988982: apt-utils: does not sort the numbers correctly. Should be smallest to largest.

Hi Nicholas,

On 5/23/21 5:21 PM, Nicholas D Steeves wrote:
On Sat, 22 May 2021 at 10:51, David Bremner <david@tethera.net <mailto:david@tethera.net>> wrote:
> Salman Mohammadi <salman@smoha.org <mailto:salman@smoha.org>> writes:
> > the command `apt-utils-search` does not sort the numbers based on integer value
> > from smallest to largest.
> >
> > How to reproduce:
> > -----------------
> >  1. M-x apt-utils-search
> >  2. Search packages for regexp: google-android-platform
> Since the function does not promise any particular order, and the order
> matches "apt search" on the command line, this seems more like a request
> for an enhancement. I guess sorting by version might be possible,
> although not trivial due to versions being complicated. Sorting by some
> number embedded in the package name sounds messy.

Salman, are you asking for a natural short, like piping a newline separated list to "sort -V" would provide?  I think this is what you're asking for.

David, AFAIK Emacs doesn't yet provide a natural sort algorithm, but is there any reason why it wouldn't be a good idea to pass the data to "sort -V" before outputting to the *APT package info* buffer?  I guess there's also the question of if a non-interactive call to apt-utils-search should return a natural sorted list...

But isn't the big question:  If a user-friendly natural sorted list is a reasonable expectation, shouldn't "apt (and aptitude) search" do this directly?  Better to fix it there, rather than in a way specific to debian-el, no?


I didn't mean exactly something like "sort -V" but an order in which something-here-24 does not fall behind something-here-3. My mistake was that I hadn't checked `apt search` for this behavior before filing a bug here. Apt gives the same order.

Here is the related bug, https://bugs.debian.org/681164 and already labeled as 'wontfix'.

Thanks, Salman

Reply to: