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

Felix Zielcke fzielcke at z-51.de
Fri Aug 8 09:01:48 UTC 2008


Just CC now both bug reports, although the difference between grub2's
and grub-legacy's update-grub should be handled differently.

Am Donnerstag, den 07.08.2008, 13:10 -0300 schrieb Henrique de Moraes
Holschuh:

> 
> > I was about unsure if I should use 'lt' 'le' 'le-nl' or 'lt-nl'
> 
> You want to return 1 for A > B and 0 otherwise.  That's how the code uses
> CompareVersions().  There is no reason to use -nl versions, the calling code
> avoids that issue entirely.
> 

On grub2 it works a bit different then grub-legacy.
CompareVersions() gets called with only 1 value instead of 2 if you have
only one kernel, I haven't tried this yet with grub-legacy.

And I concentrate more on grub2 because that's the one we replace
grub-legacy hopefully soon.

Am Donnerstag, den 07.08.2008, 20:51 +0200 schrieb Robert Millan:
>I think I got it right now, but since we failed an attempt already, and the
> code around this is so tricky, I'd appreciate if you could test this first:

On grub2 it doestn't work with just one as I currently have.

update-grub shows:

Updating /boot/grub/grub.cfg ...
Found Debian background: debian-blueish-wallpaper-640x480.png
Found linux image: 
basename: missing operand
Try `basename --help' for more information.
done

To be a bit more safe with this scripting stuff I currently have /bin/sh
as bash and not like normally as dash.

After the 2 sed calls I added an echo >/tmp/x which gives me this:

1:/boot/2.6.26-1-amd64 2: a:/boot/2.6.26-1-amd64 b:

It isn't that easy to get it working for grub2
If CompareVersions() just contains an echo 0 I get just the same as
above.
The code in 24-5 (lenny) and 30-1 (experimental) which is the one from
grub-legacy just works fine for me with only 1 kernel.







More information about the Pkg-grub-devel mailing list