* 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.
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.
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 $?