diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-03-11 15:00:37 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-03-11 15:00:37 +0000 |
commit | a3d43c6d73a78f485bfb729604c2fd89333dcafa (patch) | |
tree | e87445c493d332672fcfb8d662873650dd75c714 /perl-install | |
parent | 6c2032d8f18ae324f6795d30eac8bedda7ce4cdf (diff) | |
download | drakx-a3d43c6d73a78f485bfb729604c2fd89333dcafa.tar drakx-a3d43c6d73a78f485bfb729604c2fd89333dcafa.tar.gz drakx-a3d43c6d73a78f485bfb729604c2fd89333dcafa.tar.bz2 drakx-a3d43c6d73a78f485bfb729604c2fd89333dcafa.tar.xz drakx-a3d43c6d73a78f485bfb729604c2fd89333dcafa.zip |
- always generate a precise entry using the precise version
- remove the linux-2.4 or linux-2.6 entries which don't work together with the precise version entry
- still have the "linux" entry
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/bootloader.pm | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 1ea7051c2..9f66ab165 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -441,27 +441,18 @@ sub get_kernels_and_labels() { { complete_version => $_, /(.*mdk)(.*)/ ? (ext => $2, version => $1) : (version => $_) }; } @kernels; - my %majors; - foreach (@kernels) { - push @{$majors{$1}}, $_ if $_->{version} =~ /^(2\.\d+)/ - } - while (my ($major, $l) = each %majors) { - $l->[0]{version} = $major if @$l == 1; - } - if (-e "$::prefix/usr/lib/lsb") { my ($kernel_24, $other) = partition { $_->{ext} eq '' && $_->{version} =~ /^\Q2.4/ } @kernels; @kernels = (@$kernel_24, @$other); } - my %labels; + + my %labels = ('' => $kernels[0]{complete_version}); foreach (@kernels) { - my $label = ''; - if (exists $labels{$label}) { - $label = '-' . $_->{ext} if $_->{ext}; - } - if (exists $labels{$label}) { - $label = '-' . $_->{version} . $_->{ext}; - } + my @propositions = ( + if_($_->{ext}, '-' . $_->{ext}), + '-' . $_->{version} . $_->{ext}, + ); + my $label = find { ! exists $labels{$_} } @propositions; $labels{$label} = $_->{complete_version}; } %labels; |