summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-02-08 15:24:26 +0000
committerThierry Vignaud <tv@mandriva.org>2010-02-08 15:24:26 +0000
commit0d762a2029d46dacb7fb4616c90820e29c08722c (patch)
tree861e7eefa2a8d1407a9279aeaee7b5f13e028d81
parent12e92e3f8fac8948897e889fc1f5dcd575e44cd8 (diff)
downloaddrakx-0d762a2029d46dacb7fb4616c90820e29c08722c.tar
drakx-0d762a2029d46dacb7fb4616c90820e29c08722c.tar.gz
drakx-0d762a2029d46dacb7fb4616c90820e29c08722c.tar.bz2
drakx-0d762a2029d46dacb7fb4616c90820e29c08722c.tar.xz
drakx-0d762a2029d46dacb7fb4616c90820e29c08722c.zip
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 fd9f68a08..13135cc59 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1668,11 +1668,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 {