summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-08-08 05:47:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-08-08 05:47:02 +0000
commitc872dc4286b98f9251ad7cd30b34c3c12d611c98 (patch)
treeb1bf71ef209b3825816d48cb9d78f3adbf807943 /perl-install
parent5cf69469f016e81f8c2bfc2413a0843fc6ce9cd4 (diff)
downloaddrakx-c872dc4286b98f9251ad7cd30b34c3c12d611c98.tar
drakx-c872dc4286b98f9251ad7cd30b34c3c12d611c98.tar.gz
drakx-c872dc4286b98f9251ad7cd30b34c3c12d611c98.tar.bz2
drakx-c872dc4286b98f9251ad7cd30b34c3c12d611c98.tar.xz
drakx-c872dc4286b98f9251ad7cd30b34c3c12d611c98.zip
fix update_for_renumbered_partitions (bugzilla #16786)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/bootloader.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 4f3cf87bc..3b0c3634a 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1432,18 +1432,24 @@ sub update_for_renumbered_partitions {
} %$grub2dev;
}
+ #- NB: we make the changes with an added string inside so that hda5 is only renamed once to hda6
+
foreach (@$renumbering) {
my ($old, $new) = @$_;
log::l("renaming $old -> $new");
- $_->{new} =~ s/\b$old/$new/g foreach @configs;
+ (my $lnew = $new) =~ s/(\d+)$/__DRAKX_DONE__$1/;
+ $_->{new} =~ s/\b$old/$lnew/g foreach @configs;
any { $_->{name} eq 'grub' } @configs or next;
my ($old_grub, $new_grub) = map { device_string2grub($_, [], \@sorted_hds) } $old, $new;
log::l("renaming $old_grub -> $new_grub");
- $_->{new} =~ s/\Q$old_grub/$new_grub/g foreach @configs;
+ (my $lnew_grub = $new_grub) =~ s/\)$/__DRAKX_DONE__)/;
+ $_->{new} =~ s/\Q$old_grub/$lnew_grub/g foreach @configs;
}
+ $_->{new} =~ s/__DRAKX_DONE__//g foreach @configs;
+
my @changed_configs = grep { $_->{orig} ne $_->{new} } @configs or return 1; # no need to update
$in->ask_okcancel('', N("Your bootloader configuration must be updated because partition has been renumbered")) or return;