Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version sort order is completely broken in MC 4.8.28 #4374

Closed
mc-butler opened this issue May 23, 2022 · 23 comments
Closed

Version sort order is completely broken in MC 4.8.28 #4374

mc-butler opened this issue May 23, 2022 · 23 comments
Assignees
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.8.28 Reproducible in version 4.8.28
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4374
Reporter birdie (aros@….com)

See the attached screenshot

Note

Original attachments:

  • version.png (raw) by birdie (aros@….com) on May 23, 2022 at 9:41 UTC
@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on May 23, 2022 at 9:41 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 23, 2022 at 9:55 UTC

Replying to birdie (#4374):

See the attached screenshot

What should I see there?

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on May 23, 2022 at 10:36 UTC (comment 2)

.mozilla.ram
.wine
.ICE-unix
.X11-unix
.font-unix
.wine-1000

I don't understand this sort order: .m*, .w*, .I*, .X*, .f*, .w*? What? Why?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 23, 2022 at 17:58 UTC (comment 3)

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Branch state changed from no branch to on rework

Yes, this is a bug.

Branch: 4374_version_sort_fix
[db109be]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 29, 2022 at 9:14 UTC (comment 4)

  • Branch state changed from on rework to approved
  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 29, 2022 at 9:15 UTC (comment 5)

  • Branch state changed from approved to merged
  • Votes changed from andrew_b to committed-master
  • Resolution set to fixed
  • Status changed from accepted to testing

Merged to master: [34d3726].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on May 29, 2022 at 9:17 UTC (comment 6)

  • Status changed from testing to closed

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 3, 2022 at 7:02 UTC (comment 7)

  • Resolution fixed deleted
  • Status changed from closed to reopened

The maintainer in Fedora has applied the patch but it doesn't seem to work:

.mozilla.ram
.wine
.ICE-unix
.X11-unix
.XIM-unix
.chrome-cache
.font-unix
.vbox-birdie-ipc
.wine-1000

I don't understand this sort order.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 3, 2022 at 11:44 UTC (comment 8)

Congratulations! You found a bug (but probably this is a feature) in gnulib.

I installed coreutils-9.1 (that contains a gnulib commit [9f48fb992a3d7e96610c4ce8be969cff2d61a01b]) and I have the same result as above for ls -a1v and ls -a1 | sort -V:

.
..
.mozilla.ram
.wine
.ICE-unix
.X11-unix
.XIM-unix
.chrome-cache
.font-unix
.vbox-birdie-ipc
.wine-1000

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 3, 2022 at 12:13 UTC (comment 8.9)

Replying to andrew_b:

Congratulations! You found a bug (but probably this is a feature) in gnulib.

What's GNUlib? I don't have it installed on my Fedora 36 ;-)

Are you talking about glibc?

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 3, 2022 at 12:22 UTC (comment 10)

On Fedora 36:

sort -V 123.txt 
.ICE-unix
.X11-unix
.XIM-unix
.chrome-cache
.font-unix
.mozilla.ram
.vbox-birdie-ipc
.wine
.wine-1000

Looks correct.

$ ls --group-directories-first --sort=version -a . | cat
.
..
.ICE-unix
.X11-unix
.XIM-unix
.chrome-cache
.font-unix
.mozilla.ram
.vbox-birdie-ipc
.wine
.wine-1000

Again, it's correct.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 3, 2022 at 12:24 UTC (comment 11)

$ ls --group-directories-first -a . | sort -V
.
..
.ICE-unix
.X0-lock
.X11-unix
.XIM-unix
.chrome-cache
.font-unix
.mozilla.ram
.vbox-birdie-ipc
.wine
.wine-1000

Also correct.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 3, 2022 at 12:25 UTC (comment 12)

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 3, 2022 at 15:27 UTC (comment 9.13)

Replying to birdie:

Are you talking about glibc?

No, I'm talking about gnulib, a base library for many GNU tools, including coreutils.

On Fedora 36

This says me nothing. I'm not Fedora user. Show the output of ls --version or rpm -q coreutuls.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 3, 2022 at 15:40 UTC (comment 14)

ls --version
ls (GNU coreutils) 9.0

rpm -q coreutils
coreutils-9.0-5.fc36.x86_64

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 3, 2022 at 16:26 UTC (comment 15)

Change 9f48fb992a3d7e96610c4ce8be969cff2d61a01b was committed to gnulib 2022-02-12. Coreutils-9.1 was released 2022-04-15 and contains this change.

The version sort of ls-9.1 will differ than one of ls-9.0. Now this will not come as a surprise to you.
But you can try convince the gnulib developers that this is a bug: bug-gnulib@gnu.org.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 4, 2022 at 7:52 UTC (comment 16)

I've emailed the gnulib bug mailing list, they've confirmed the regression and the patch has already been released.

It's quite disturbing how ostensibly millions of people use Linux, yet I uncover such major bugs.

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 4, 2022 at 7:52 UTC (comment 17)

  • Summary changed from Version sort order is completely broken in MC 4.8.28 to Version sort order is completely broken in MC 4.8.28 [not our bug]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 4, 2022 at 8:29 UTC (comment 18)

  • Summary changed from Version sort order is completely broken in MC 4.8.28 [not our bug] to Version sort order is completely broken in MC 4.8.28
  • Branch state changed from merged to on review
  • Votes committed-master deleted

Branch: 4374_version_sort_fix2
[dc67246]

@mc-butler
Copy link
Author

Changed by birdie (aros@….com) on Jun 4, 2022 at 8:34 UTC (comment 19)

Andrew, thanks a ton!

Is the patch from comment #3 still required?

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 4, 2022 at 8:53 UTC (comment 19.20)

Replying to birdie:

Andrew, thanks a ton!

Is the patch from comment #3 still required?

Yes.

I'll merge this branch to master today.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 4, 2022 at 17:58 UTC (comment 21)

  • Branch state changed from on review to approved
  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jun 4, 2022 at 17:59 UTC (comment 22)

  • Resolution set to fixed
  • Branch state changed from approved to merged
  • Status changed from reopened to closed
  • Votes changed from andrew_b to committed-master

Merged to master: [0e583d7].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.8.28 Reproducible in version 4.8.28
Development

No branches or pull requests

2 participants