summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-02-03 23:38:12 +0000
committerThierry Vignaud <tv@mandriva.org>2010-02-03 23:38:12 +0000
commitc47837af18ff9ba076ad826c5bc9606726195d78 (patch)
tree3bf53a7772726a6f35b27925cfb663a77f11a83f
parentb3117f6040885a77c19556fd06047d31b98270d2 (diff)
downloaddrakx-c47837af18ff9ba076ad826c5bc9606726195d78.tar
drakx-c47837af18ff9ba076ad826c5bc9606726195d78.tar.gz
drakx-c47837af18ff9ba076ad826c5bc9606726195d78.tar.bz2
drakx-c47837af18ff9ba076ad826c5bc9606726195d78.tar.xz
drakx-c47837af18ff9ba076ad826c5bc9606726195d78.zip
(write_grub::format) factorize code
-rw-r--r--perl-install/bootloader.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 07a770f49..95e3f7192 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1708,11 +1708,13 @@ sub write_grub {
delete $bootloader->{gfxmenu};
}
+ my $format = sub { map { "$_ $bootloader->{$_}" } @_ };
+
{
my @conf;
- push @conf, map { "$_ $bootloader->{$_}" } grep { defined $bootloader->{$_} } qw(timeout);
- push @conf, map { "$_ $bootloader->{$_}" } grep { $bootloader->{$_} } qw(color password serial shade terminal viewport background foreground);
+ push @conf, $format->(grep { defined $bootloader->{$_} } qw(timeout));
+ push @conf, $format->(grep { $bootloader->{$_} } qw(color password serial shade terminal viewport background foreground));
push @conf, map { $_ . ' ' . $file2grub->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(gfxmenu);
eval {