All of lore.kernel.org
 help / color / mirror / Atom feed
* Remove the usage of "local" in scripts introduces a small bug in "version_test_gt()"
@ 2011-11-28  9:08 Lukas Anzinger
  2011-12-23 11:02 ` Vladimir 'φ-coder/phcoder' Serbinenko
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Anzinger @ 2011-11-28  9:08 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi,

it looks to me that the patch which removes the usage of "local" in
scripts (http://lists.gnu.org/archive/html/grub-devel/2011-11/msg00037.html)
introduces a bug in the function version_test_gt() in the file
util/grub-mkconfig_lib.in:

The variable $cmp is set to "gt" or "ge", however,
$version_test_gt_cmp is used instead and the case has no effect.

This patch should fix it:

--- a/util/grub-mkconfig_lib.in	2011-11-28 09:42:11.000000000 +0100
+++ b/util/grub-mkconfig_lib.in	2011-11-28 10:00:00.000000000 +0100
@@ -198,8 +198,8 @@
   fi
   case "$version_test_gt_a:$version_test_gt_b" in
     *.old:*.old) ;;
-    *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed
-e 's/\.old$//'`" ; cmp=gt ;;
-    *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed
-e 's/\.old$//'`" ; cmp=ge ;;
+    *.old:*) version_test_gt_a="`echo -n "$version_test_gt_a" | sed
-e 's/\.old$//'`" ; version_test_gt_cmp=gt ;;
+    *:*.old) version_test_gt_b="`echo -n "$version_test_gt_b" | sed
-e 's/\.old$//'`" ; version_test_gt_cmp=ge ;;
   esac
   version_test_numeric "$version_test_gt_a" "$version_test_gt_cmp"
"$version_test_gt_b"
   return "$?"

I noticed the problem when I tried to apply the patch
"dpkg_version_comparison.patch" from Debian.

Maybe someone should take a look at the other variables ...

Regards,

Lukas


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-23 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-28  9:08 Remove the usage of "local" in scripts introduces a small bug in "version_test_gt()" Lukas Anzinger
2011-12-23 11:02 ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.