summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-28 12:43:24 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-28 12:43:24 +0000
commitfc49ee5fb4bec4b735c5995053380f05d01ee044 (patch)
tree9b1f5b5553b544babb11598fc4e77e8e7a3b1878
parent920d55ddeb3a031d640c9e04b4147b5688c3351d (diff)
downloaddrakx-fc49ee5fb4bec4b735c5995053380f05d01ee044.tar
drakx-fc49ee5fb4bec4b735c5995053380f05d01ee044.tar.gz
drakx-fc49ee5fb4bec4b735c5995053380f05d01ee044.tar.bz2
drakx-fc49ee5fb4bec4b735c5995053380f05d01ee044.tar.xz
drakx-fc49ee5fb4bec4b735c5995053380f05d01ee044.zip
- compare labels case insensitively (thanks to D.Faure)
- when reading existing config, remove double quotes around the label (thanks to D.Faure) - add double quotes around the label instead of removing spaces (need checking installkernel compatibility)
-rw-r--r--perl-install/bootloader.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 0b838ba52..d1676af98 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -47,7 +47,7 @@ sub get {
}
sub get_label {
my ($label, $bootloader) = @_;
- $_->{label} && substr($_->{label}, 0, 15) eq substr($label, 0, 15) and return $_ foreach @{$bootloader->{entries}};
+ $_->{label} && lc(substr($_->{label}, 0, 15)) eq lc(substr($label, 0, 15)) and return $_ foreach @{$bootloader->{entries}};
undef;
}
@@ -117,7 +117,14 @@ sub read() {
}
if (arch() !~ /ppc/) {
delete $b{timeout} unless $b{prompt};
- $_->{append} =~ s/^\s*"?(.*?)"?\s*$/$1/ foreach \%b, @{$b{entries}};
+ sub remove_quotes_and_spaces {
+ local ($_) = @_;
+ s/^\s*//; s/\s*$//;
+ s/^"(.*?)"$/$1/;
+ $_;
+ }
+ $_->{append} = remove_quotes_and_spaces($_->{append}) foreach \%b, @{$b{entries}};
+ $_->{label} = remove_quotes_and_spaces($_->{label}) foreach @{$b{entries}};
$b{timeout} = $b{timeout} / 10 if $b{timeout};
$b{message} = cat_("$::prefix$b{message}") if $b{message};
}
@@ -745,8 +752,7 @@ sub install_silo {
sub make_label_lilo_compatible {
my ($label) = @_;
$label = substr($label, 0, 15); #- lilo doesn't handle more than 15 char long labels
- $label =~ s/\s/_/g; #- lilo doesn't like spaces
- $label;
+ qq("$label");
}
sub write_lilo_conf {