From 6774e3255b1db6b2a777db8b66c9744345e87004 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 30 Aug 2005 10:52:57 +0000 Subject: create suggest_message_text() --- perl-install/bootloader.pm | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'perl-install') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index e296bb46c..e8f9db2e7 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -722,6 +722,25 @@ sub sanitize_ver { $return; } +sub suggest_message_text { + my ($bootloader) = @_; + + if (!$bootloader->{message} && !$bootloader->{message_text} && arch() !~ /ia64/) { + my $msg_en = +#-PO: these messages will be displayed at boot time in the BIOS, use only ASCII (7bit) +N_("Welcome to the operating system chooser! + +Choose an operating system from the list above or +wait for default boot. + +"); + my $msg = translate($msg_en); + #- use the english version if more than 20% of 8bits chars + $msg = $msg_en if int(grep { $_ & 0x80 } unpack "c*", $msg) / length($msg) > 0.2; + $bootloader->{message_text} = $msg; + } +} + sub suggest { my ($bootloader, $all_hds, %options) = @_; my $fstab = [ fs::get::fstab($all_hds) ]; @@ -759,20 +778,7 @@ sub suggest { ), }); - if (!$bootloader->{message} && !$bootloader->{message_text} && arch() !~ /ia64/) { - my $msg_en = -#-PO: these messages will be displayed at boot time in the BIOS, use only ASCII (7bit) -N_("Welcome to the operating system chooser! - -Choose an operating system from the list above or -wait for default boot. - -"); - my $msg = translate($msg_en); - #- use the english version if more than 20% of 8bits chars - $msg = $msg_en if int(grep { $_ & 0x80 } unpack "c*", $msg) / length($msg) > 0.2; - $bootloader->{message_text} = $msg; - } + suggest_message_text($bootloader); add2hash_($bootloader, { memsize => $1 }) if cat_("/proc/cmdline") =~ /\bmem=(\d+[KkMm]?)(?:\s.*)?$/; if (my ($s, $port, $speed) = cat_("/proc/cmdline") =~ /console=(ttyS(\d),(\d+)\S*)/) { -- cgit v1.2.1