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.
This commit is contained in:
parent
29a6b9e8fa
commit
2f5cb8278a
2 changed files with 8 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
||||||
2009-08-08 Pavel Roskin <proski@gnu.org>
|
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
|
* util/grub-mkconfig.in: Define datarootdir, datadir may depend
|
||||||
on it. Add missing space before closing bracket. Fix
|
on it. Add missing space before closing bracket. Fix
|
||||||
misleading formatting.
|
misleading formatting.
|
||||||
|
|
|
@ -185,16 +185,16 @@ version_test_numeric ()
|
||||||
|
|
||||||
version_test_gt ()
|
version_test_gt ()
|
||||||
{
|
{
|
||||||
local a=`echo $1 | sed -e "s/[^-]*-//g"`
|
local a=`echo $1 | sed -e "s/[^-]*-//"`
|
||||||
local b=`echo $2 | sed -e "s/[^-]*-//g"`
|
local b=`echo $2 | sed -e "s/[^-]*-//"`
|
||||||
local cmp=gt
|
local cmp=gt
|
||||||
if [ "x$b" = "x" ] ; then
|
if [ "x$b" = "x" ] ; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
case $a:$b in
|
case $a:$b in
|
||||||
*.old:*.old) ;;
|
*.old:*.old) ;;
|
||||||
*.old:*) a=`echo -n $a | sed -e s/\.old$//g` ; cmp=gt ;;
|
*.old:*) a=`echo -n $a | sed -e s/\.old$//` ; cmp=gt ;;
|
||||||
*:*.old) b=`echo -n $b | sed -e s/\.old$//g` ; cmp=ge ;;
|
*:*.old) b=`echo -n $b | sed -e s/\.old$//` ; cmp=ge ;;
|
||||||
esac
|
esac
|
||||||
version_test_numeric $a $cmp $b
|
version_test_numeric $a $cmp $b
|
||||||
return $?
|
return $?
|
||||||
|
|
Loading…
Reference in a new issue