From 2f5cb8278a707c3b047aace9c8c778a4c7c231e7 Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 8 Aug 2009 05:37:49 +0000 Subject: [PATCH] 2009-08-08 Pavel Roskin * util/grub-mkconfig_lib.in (version_test_numeric): Don't use the "g" modifier in sed when the intention is to strip something once. This fixes comparison of kernels with multiple dashes. --- ChangeLog | 4 ++++ util/grub-mkconfig_lib.in | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c8a14664..3b252ee6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-08-08 Pavel Roskin + * util/grub-mkconfig_lib.in (version_test_numeric): Don't use + the "g" modifier in sed when the intention is to strip something + once. This fixes comparison of kernels with multiple dashes. + * util/grub-mkconfig.in: Define datarootdir, datadir may depend on it. Add missing space before closing bracket. Fix misleading formatting. diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 99b3c9c6f..3585a68ef 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -185,16 +185,16 @@ version_test_numeric () version_test_gt () { - local a=`echo $1 | sed -e "s/[^-]*-//g"` - local b=`echo $2 | sed -e "s/[^-]*-//g"` + local a=`echo $1 | sed -e "s/[^-]*-//"` + local b=`echo $2 | sed -e "s/[^-]*-//"` local cmp=gt if [ "x$b" = "x" ] ; then return 0 fi case $a:$b in *.old:*.old) ;; - *.old:*) a=`echo -n $a | sed -e s/\.old$//g` ; cmp=gt ;; - *:*.old) b=`echo -n $b | sed -e s/\.old$//g` ; cmp=ge ;; + *.old:*) a=`echo -n $a | sed -e s/\.old$//` ; cmp=gt ;; + *:*.old) b=`echo -n $b | sed -e s/\.old$//` ; cmp=ge ;; esac version_test_numeric $a $cmp $b return $?