grub2/0216-Correct-sorting-of-kernel-names-containing-_.patch
Robbie Harwood 93004a8494 Use my sort patch instead
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-03-21 17:54:55 +00:00

35 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Tue, 18 Jan 2022 12:22:15 -0500
Subject: [PATCH] Correct sorting of kernel names containing '_'
sort(1) from GNU coreutils does not treat underscore as part of a
version number for `sort -V. This causes misorderings on x86_64, where
e.g. kernel-core-3.17.6-300.11.fc21.x86_64 will incorrectly sort
*before* kernel-core-3.17.6-300.fc21.x86_64.
To cope with this behavior, replace underscores with dashes in order to
approximate their intended meaning as version component separators.
Fixes: https://savannah.gnu.org/bugs/?42844
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
util/grub-mkconfig_lib.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 301d8a8a1e4..57fb95e3aeb 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -261,8 +261,8 @@ version_test_numeric ()
version_test_gt ()
{
- version_test_gt_a="`echo "$1" | sed -e "s/[^-]*-//"`"
- version_test_gt_b="`echo "$2" | sed -e "s/[^-]*-//"`"
+ version_test_gt_a="`echo "$1" | sed -e "s/[^-]*-//" -e "s/_/-/g"`"
+ version_test_gt_b="`echo "$2" | sed -e "s/[^-]*-//" -e "s/_/-/g"`"
version_test_gt_cmp=gt
if [ "x$version_test_gt_b" = "x" ] ; then
return 0