]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-08-08 Pavel Roskin <proski@gnu.org>
authorproski <proski@localhost>
Sat, 8 Aug 2009 05:37:49 +0000 (05:37 +0000)
committerproski <proski@localhost>
Sat, 8 Aug 2009 05:37:49 +0000 (05:37 +0000)
* 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
util/grub-mkconfig_lib.in

index 1c8a146647c5717060437656b2488f7d8e0ea25c..3b252ee6b16cb0c401ac52695772817adef9fd1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-08-08  Pavel Roskin  <proski@gnu.org>
 
+       * 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.
index 99b3c9c6f26fcc99f2ed25347b01ecfd3fb58cbd..3585a68ef4ec6f66214bd96e033c98030b03b93c 100644 (file)
@@ -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 $?