diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-08-04 03:14:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-08-04 03:14:02 +0000 |
commit | cc2a880218bd822f637016c2dcd5e8a859fa5272 (patch) | |
tree | 020a28fc6084a5994228105d935b706244f0bfc4 /perl-install/bootloader.pm | |
parent | de56ae5fd40f3aad5e5f35910ba09c7c3b5fd0b8 (diff) | |
download | drakx-cc2a880218bd822f637016c2dcd5e8a859fa5272.tar drakx-cc2a880218bd822f637016c2dcd5e8a859fa5272.tar.gz drakx-cc2a880218bd822f637016c2dcd5e8a859fa5272.tar.bz2 drakx-cc2a880218bd822f637016c2dcd5e8a859fa5272.tar.xz drakx-cc2a880218bd822f637016c2dcd5e8a859fa5272.zip |
try to keep the order of kernel options (to help same_entries())
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 22df2c805..56cb73d9a 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -500,11 +500,21 @@ sub set_append { modify_append($b, sub { my ($simple, $dict) = @_; if ($has_val) { - @$dict = grep { $_->[0] ne $key || $key eq 'mem' && append__mem_is_memsize($_->[1]) != append__mem_is_memsize($val) } @$dict; - push @$dict, [ $key, $val ] if !($val eq '' || $key eq 'mem' && !$val); + my $to_add = $key eq 'mem' ? $val : $val ne ''; + @$dict = map { + if ($_->[0] ne $key || $key eq 'mem' && append__mem_is_memsize($_->[1]) != append__mem_is_memsize($val)) { + $_; + } elsif ($to_add) { + $to_add = 0; + [ $key, $val ]; + } else { + (); + } + } @$dict; + + push @$dict, [ $key, $val ] if $to_add; } else { - @$simple = grep { $_ ne $key } @$simple; - push @$simple, $key; + @$simple = uniq(@$simple, $key); } }); } |