Bug#494158: [grub2] update-grub: uses wrong ordering algorithm (sorts 1.2.3-foo before 1.2.3.1-foo)

Henrique de Moraes Holschuh hmh at debian.org
Fri Aug 8 12:49:02 UTC 2008


On Fri, 08 Aug 2008, Felix Zielcke wrote:
> I couldn't figure out with playing with this ~ thingy how to tell dpkg that -rc1-git1 is higher then -rc1

khazad-dum:~$ dpkg --compare-versions 2.6.23.1-rc1-git3 gt 2.6.23.1-rc1 ; echo $?
0
khazad-dum:~$ dpkg --compare-versions 2.6.23.1~rc1-git3 gt 2.6.23.1~rc1 ; echo $?
0

It will do the right thing, as long as you don't get two "~" in there.  You
cannot mangle the version string to ~git#~rc# (or ~-git#-~rc#, etc), as that
will certainly not give you the right order :P

> So it seems like dpkg --compare-versions isn't that perfect for official kernel.org patch numbering ;)

No, it isn't, otherwise we would not need mangling :)  But it *CAN* do all
that is needed, if we use "~" correctly.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh





More information about the Pkg-grub-devel mailing list