summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-28 19:59:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-28 19:59:54 +0000
commit894627271072a1b4bc7c9e476e99da856e4ab2a0 (patch)
tree2332a32c7f581528fef731ddfefa778371d008c5 /perl-install/diskdrake
parented167f27c63d598a0ebb35276e4a20ea8bb5ad98 (diff)
downloaddrakx-backup-do-not-use-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar
drakx-backup-do-not-use-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar.gz
drakx-backup-do-not-use-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar.bz2
drakx-backup-do-not-use-894627271072a1b4bc7c9e476e99da856e4ab2a0.tar.xz
drakx-backup-do-not-use-894627271072a1b4bc7c9e476e99da856e4ab2a0.zip
warn if partitions have been renumbered due to a partition being added or removed
Diffstat (limited to 'perl-install/diskdrake')
-rw-r--r--perl-install/diskdrake/interactive.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 2a86d73af..22b508d60 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -106,6 +106,9 @@ struct hd {
bool needKernelReread # must we tell the kernel to reread the partition table
bool hasBeenDirty # for undo
bool rebootNeeded # happens when a kernel reread failed
+ bool partitionsRenumbered # happens when you
+ # - remove an extended partition which is not the last one
+ # - add an extended partition which is the first extended partition
int bus, id
partition_table_elem primary
@@ -451,6 +454,8 @@ sub Create {
},
) or return;
+ warn_if_renumbered($in, $hd);
+
if ($migrate_files eq 'migrate') {
format_($in, $hd, $part, $all_hds) or return;
migrate_files($in, $hd, $part);
@@ -478,6 +483,7 @@ sub Delete {
undef $partition_table_mac::bootstrap_part if (isAppleBootstrap($part) && ($part->{device} = $partition_table_mac::bootstrap_part));
}
partition_table::remove($hd, $part);
+ warn_if_renumbered($in, $hd);
}
}
@@ -985,6 +991,14 @@ sub migrate_files {
}
}
+sub warn_if_renumbered {
+ my ($in, $hd) = @_;
+ my $l = delete $hd->{partitionsRenumbered};
+ return if is_empty_array_ref($l);
+
+ my @l = map { _("partition %s is now known as %s", @$_) } @$l;
+ $in->ask_warn('', join("\n", 'Partitions have been renumbered: ', @l));
+}
#- unit of $mb is mega bytes, min and max are in sectors, this
#- function is used to convert back to sectors count the size of