All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robbie Harwood <rharwood@redhat.com>
To: development@efficientek.com
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Correct sorting of kernel names containing '_'
Date: Wed, 19 Jan 2022 13:52:40 -0500	[thread overview]
Message-ID: <jlgmtjr5zif.fsf@redhat.com> (raw)
In-Reply-To: <20220118155701.3e0ed255@crass-HP-ZBook-15-G2>

[-- Attachment #1: Type: text/plain, Size: 2745 bytes --]

Glenn Washburn <development@efficientek.com> writes:

> This seems like a simple solution. Not being in the weeds on this, can
> you comment on the short coming of changing the '_' to '-'? Are there
> any known version string formats where this would be worse? At the
> moment, it seems like a good incremental solution.

I think in order for it to be a problem, someone / some packaging system
would have to be relying on '_' to not be part of the version.  All
package managers I'm aware of have the version at the end - i.e., after
the package name.[1]

The only real "drawback" I'm aware of is that this still leaves
https://savannah.gnu.org/bugs/?42921 (and any other inconsistencies
between distro sort and `sort -V`) unaddressed - but none of the other
proposals listed would help with that either.  (Fedora avoids this
particular issue by mandating prerelease versions start with 0 - for
instance, rather than making the 3.16.0-rc6 as gentoo did in that bug,
we make 3.16.0-0.rc6 .)

>> - Invoke rpmdev-vercmp if available.  Problem here is that it may not be
>>   (it's not part of the rpm package itself on Fedora, but rather
>>   rpmdev-tools), and again, won't generalize to non-RPM distros.
>
> I like this as a supplement to this patch. I'm thinking first identify
> the distro (using /etc/os-release?), if known RPM distro look for
> rpmdev-vercmp, else look for dpkg (to use dpkg --compare-versions), and
> if neither is found fall back to this approach. This could be extended
> to other package manager compare logic as desired.

Interesting.  Doing this for rpmdev-vercmp alone still doesn't seem
worth the effort to me, but dpkg --compare-versions is more attractive
since it'll be installed for sure.  I'll see if I can make something
tolerable.

>> - Strip out any dot-delimited section that contains non-numerics.
>> This has also been written and is the attached solution to
>> https://savannah.gnu.org/bugs/?42844 - but since it hasn't been
>> merged in the six years since posting, I have to assume it's been
>> rejected.  It also would not correctly handle the case of
>> e.g. kernel-core-2.6.32-1_test2.x86_64 vs kernel-core-2.6.32-1.x86_64
>
> This patch actually removes the last part of the version string
> starting with the first dot segment whose first character is
> non-numeric. Regardless, this doesn't seem like a great approach.

Oops, yes.

Be well,
--Robbie

1: This ignores things like epoch, but I'm not aware of any distro using
   an epoch-like versioning for the kernel, nor does it seem likely that
   Linux will change its versioning scheme in a way that breaks "normal"
   version sorting.  It would also be broken right now, though, which is
   why I've buried mention of it it in a footnote :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2022-01-19 18:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18 17:29 [PATCH] Correct sorting of kernel names containing '_' Robbie Harwood
2022-01-18 17:56 ` Robbie Harwood
2022-01-18 21:57   ` Glenn Washburn
2022-01-19 18:52     ` Robbie Harwood [this message]
2022-01-19 21:33     ` [PATCH] mkconfig: use distro sorts when available Robbie Harwood
2022-01-20  0:36       ` Glenn Washburn
2022-01-20  1:17       ` Glenn Washburn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jlgmtjr5zif.fsf@redhat.com \
    --to=rharwood@redhat.com \
    --cc=development@efficientek.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.