Bug#494158: [grub2] update-grub: uses wrong ordering algorithm (sorts 1.2.3-foo before 1.2.3.1-foo)
Felix Zielcke
fzielcke at z-51.de
Sat Aug 9 09:12:03 UTC 2008
Am Freitag, den 08.08.2008, 19:59 -0300 schrieb Henrique de Moraes
Holschuh:
> 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).
Oh sorry that I didn't make it clear.
2.6.26-1-amd64-rc1-git1 should be BELOW 2.6.26-1-amd64.
When there are 2 ~ then it does work in that case.
If there's only one then it does NOT work in that case.
See here with 1 (i.e. from Robert's regexp the greedy /g removed)
~rc1-git1
Found linux image: /boot/vmlinuz-2.6.26-1-amd64-rc1-git1
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64-rc1
Here with the greedy regexp. i.e ~rc1~git1
Found linux image: /boot/vmlinuz-2.6.26-1-amd64
Found initrd image: /boot/initrd.img-2.6.26-1-amd64
Found linux image: /boot/vmlinuz-2.6.26-1-amd64-rc1
Found linux image: /boot/vmlinuz-2.6.26-1-amd64-rc1-git1
I try to say it in other words:
The dash AFTER the ~ seems to reset the `~ means lower then empty
string'
~rc1-git1 is treated NEWER then the one with the empty string.
It doestn't matter (at least for the lenny release) if this is a bug or
if that is intendet, we have to find a solution for this problem.
>
> Heh. I will try to take a stab at it in two or three days.
>
Thanks very much :)
And I forgot the method used before (and still in lenny)
sorted -test below -rc but I think we just need to replace ~test with
~atest or something like that to make that work.
More information about the Pkg-grub-devel
mailing list