Bug 1322888 - dnf output lines are sorted by *length* of package names, not alphabetically
Summary: dnf output lines are sorted by *length* of package names, not alphabetically
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-31 14:22 UTC by Armin Jenewein
Modified: 2016-04-08 01:37 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-08 01:37:15 UTC
Type: Bug


Attachments (Terms of Use)
Here is a screenshot showcasing the problem (173.04 KB, image/png)
2016-03-31 14:22 UTC, Armin Jenewein
no flags Details

Description Armin Jenewein 2016-03-31 14:22:04 UTC
Created attachment 1142239 [details]
Here is a screenshot showcasing the problem

Description of problem:
dnf output lines are sorted by *length* of package names, not alphabetically

Version-Release number of selected component (if applicable):
1.1.7
  Installed: dnf-0:1.1.7-2.fc23.noarch at 2016-03-24 12:44
  Built    : Fedora Project at 2016-03-09 16:45

  Installed: rpm-0:4.13.0-0.rc1.12.fc23.x86_64 at 2016-03-24 12:43
  Built    : Fedora Project at 2016-02-29 09:53

How reproducible:
"dnf search <foobar>"

Actual results:
Output lines are sorted by the *length* of package names (see attached screenshot).

Expected results:
Results should be sorted in some way.

Comment 1 Honza Silhan 2016-04-04 11:42:43 UTC
The output is sorted by different heuristic. The more relevant result, the more to the top. I.e. is the string inside summary, description, pkgname, etc.

Sort by the length in your case is just coincidence.

Comment 2 Armin Jenewein 2016-04-05 22:51:13 UTC
Hi.

You are relating to the sorting of the type of match. What I'm trying to report here is the sorting *within* those groups. The groups are sorted, their contents are not.

To reproduce, just do a "yum search x" for example. You'll see 2 groups scrolling down, the first one being the match of the package names, the second one the descriptions. I would agree that showing the group of package names is more relevant, but shouldn't the inner package names be sorted in some different way than the length of the package name!?

Hence, re-opening.

Armin

Comment 3 Armin Jenewein 2016-04-05 22:52:58 UTC
s/yum/dnf/g - I just got used to it, my apologies. :-)

Comment 4 Armin Jenewein 2016-04-08 01:37:01 UTC
Hi.

Took me some time to understand what the relevance means in this context and it makes sense to me. Still a pretty confusing behaviour, and it constantly leads me to use mad constructs like 

sudo yum search x | grep -E '^[a-zA-Z0-9]' | sort | less -R

for example. 

I think one could debate the implementation of an optional alphabetical sort, but I have to agree with you, Jan.

Jan, thanks a lot for your help and your understanding. Closing this bug-report.

- Armin


Note You need to log in before you can comment on or make changes to this bug.