From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nAG4p-0004R9-CB for mharc-grub-devel@gnu.org; Wed, 19 Jan 2022 13:52:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAG4o-0004OM-23 for grub-devel@gnu.org; Wed, 19 Jan 2022 13:52:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22293) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAG4k-0006jr-I9 for grub-devel@gnu.org; Wed, 19 Jan 2022 13:52:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642618369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kTHGf2RjTKtiVD5h0NhM2+t69ksfY3qn+tpkzKaWFH8=; b=dcTbAO5Pjqqy27ZGmhnMXrSTZtNDOOLK/ArrDPgx95tHaoAb759jy9aeJewKzcOp/43cAm WmtwqfZHB8NuCXJn3koumSONR84bXJKhoVpx+ufMeVBE61hiqS36mN5PVyxiFcHsFZH66t nBuRI+VF13sY6L/Xylriym2CLfW9m5Y= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-508-LTJve87CMkW_sc-pQczFTw-1; Wed, 19 Jan 2022 13:52:45 -0500 X-MC-Unique: LTJve87CMkW_sc-pQczFTw-1 Received: by mail-qv1-f72.google.com with SMTP id kd18-20020a056214401200b0041c3942383aso3678227qvb.9 for ; Wed, 19 Jan 2022 10:52:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=kTHGf2RjTKtiVD5h0NhM2+t69ksfY3qn+tpkzKaWFH8=; b=bYu5k2bDvGgFtAVpkYWtvu9TptdCJPU71bicVQgJgTe8hhvQ0tPCwQaidtnkTUAW8F 3R8JPlAfBrDWcUW6bk+4JABCLyKNkZj8/yfgQhp0JdmbxqlVvsOiWmspSuIQiPbeLNv0 l2JfoBqRRrbxqTcRAPuBvd6J8589jSdjtFUPjrRJPny25qsAtnsF9p91kl7DVRMcwa4x j81qBCRukvOMIOWfeTMh22EYpDHtm4PFkXTIq2GTurqeh3b77q55mtTpfU28ebqTdvnL ZledY+HJVezKIswKH1b+C3FGDdVNZ1Rx1d8+J1Br+JFCNqV4RdE0bVAIS1bRzmBz9Gh9 zf8A== X-Gm-Message-State: AOAM533QLIlBo4qlVQulhmfrH9oO9HjC7vJaxHnz5j1kN61NDKJ6DQ10 4zZeEXADKP7yeXRitN0LTPSdz3jyc/n8e9pTVNF6zXlNgTru7fIi4vKM4Xk7EM4V6bDpjYjvDgG YFmyHtVe4tQo= X-Received: by 2002:ae9:e854:: with SMTP id a81mr19803277qkg.669.1642618364664; Wed, 19 Jan 2022 10:52:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrvB5dG3YHzJQxVf0rMa2xm2HwK0Mk/5sDK6fAfGGmRdQ1k1JA+tL9n/XBBCsGMp6X+no4NA== X-Received: by 2002:ae9:e854:: with SMTP id a81mr19803244qkg.669.1642618363740; Wed, 19 Jan 2022 10:52:43 -0800 (PST) Received: from localhost ([2601:184:4181:74c0:862e:5809:ed9e:e10e]) by smtp.gmail.com with ESMTPSA id h9sm338993qkp.75.2022.01.19.10.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 10:52:43 -0800 (PST) From: Robbie Harwood To: development@efficientek.com Cc: The development of GNU GRUB Subject: Re: [PATCH] Correct sorting of kernel names containing '_' In-Reply-To: <20220118155701.3e0ed255@crass-HP-ZBook-15-G2> References: <20220118172943.9903-1-rharwood@redhat.com> <20220118155701.3e0ed255@crass-HP-ZBook-15-G2> Date: Wed, 19 Jan 2022 13:52:40 -0500 Message-ID: MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=rharwood@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=170.10.133.124; envelope-from=rharwood@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2022 18:52:58 -0000 --=-=-= Content-Type: text/plain Glenn Washburn 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 :) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEA5qc6hnelQjDaHWqJTL5F2qVpEIFAmHoXfgUHHJoYXJ3b29k QHJlZGhhdC5jb20ACgkQJTL5F2qVpEIoBw//Q4Wr2MVXk5zfexKwJR9dC8/u/gv7 zdi0NYiQICOa1MIQwtcTUzswqkTETG91HDo/VcD0Jy3r1/92HuoDgri3cEYI+/V2 +F/Elw7SLSxPWc/apwwnXYnclpPmyCMR3Yx9V5Es/BuUQdl6Xu48+7naZgvWyyIW alZdIgf/Ub7xMO5+u2BYorku8E6yxQmk5eIjT659BB/pwbfHAEB6YARnZX3t+83B tm8To012c+m4u8Jp/FFzHYzS4MTxH3jJwR1b2SJk3vEid1O2rDQRH5PGZBVcuhLr SXYlsfEZ4yFwnLsVdN96iDn059Pjuf/2jaFG+Y8BYgMH3OoXJCYSFCqc1ROCzqKA eFTAslC/63/dF7qa7E768Vf9WUgM4Limkhug/bTCrHI427DDGE8deDNFbs65tyrc BnwNF1BkCWFb9Qd3n3TThEDjNoQaTkvA/TWOEH3NWsX0z4UE5y++HjXIR7VC4VGW rPEqychrQ4Z5FiTXtgZaZexSUFnawiLU9vVFOZK3137cpwQsruzeq0GUk6HWEZJv iyPaRtOhWw7S33OUk+Xe8tsmoYPTb1n9tSmBnCUrJ0rD7+8KalQ08vSNUd2Ro6YV tUzq5BbEPf0Rfz3iPkhHeWoy8SnfMWsjzF9HGXR2FBRD9H1dKvPRE36ABwPgXDl/ 2HLIBJGEb4+/ZV0= =rfCQ -----END PGP SIGNATURE----- --=-=-=--