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 22:59:55 UTC 2008


On Fri, 08 Aug 2008, Felix Zielcke wrote:
> I really should have sticked with my easy debugging method I already
> mentioned in the report (that echo >> /tmp/x thingy)
> I thought removing the greedy g on the regexps would just solve the
> problem for us, but it doestn't:
> 
> fz:/etc/grub.d# dpkg --compare-versions 2.6.26-1-amd64~rc1-git1 gt 2.6.26-1-amd64; echo $?
> 0
> fz:/etc/grub.d# dpkg --compare-versions 2.6.26-1-amd64~rc1~git1 gt 2.6.26-1-amd64; echo $?
> 1
> 
> This looks for me more then a dpkg issue.
> ~x-y should be like ~x~y i.e. that the above one returns the same.

No, dpkg is quite correct in its implementation of "~".  You really need to
use it only once on kernel-style -rc prefixes (i.e. prefixes that mean you
are BEFORE a given version).

> Maybe I just think again too difficult.

Heh. I will try to take a stab at it in two or three days.

> 2.6.26-mm1 is higher/newer then 2.6.26

Correct.

> -mm patches contain the things which should go into the next kernel releases.
> But there's again this double problem i.e. -rc1-mm1:

x.y.z.k-rc1-mm1 is BEFORE x.y.z.k (because of -rc1), and it is AFTER -rc1.
The sorting will work with just one ~ (i.e. x.y.z.k~rc1-mm1 versus x.y.z.k
and x.y.z.k~rc1).  And x.y.z.k-mm1 is AFTER them all (i.e. -mm is not to go
into the "place a ~ before it" regexp).

-- 
  "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