summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-29 20:34:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-29 20:34:31 +0000
commit49efec557b1339fa90bec3b6b3edbb6023595ed3 (patch)
treed072822fb78deef87446c2becb6328fe6a0232d0
parent667f6dc5830137b4cd9d9b4969960486213c2049 (diff)
downloaddrakx-backup-do-not-use-49efec557b1339fa90bec3b6b3edbb6023595ed3.tar
drakx-backup-do-not-use-49efec557b1339fa90bec3b6b3edbb6023595ed3.tar.gz
drakx-backup-do-not-use-49efec557b1339fa90bec3b6b3edbb6023595ed3.tar.bz2
drakx-backup-do-not-use-49efec557b1339fa90bec3b6b3edbb6023595ed3.tar.xz
drakx-backup-do-not-use-49efec557b1339fa90bec3b6b3edbb6023595ed3.zip
nicer error message when "You can't create a new partition
(since you reached the maximal number of primary partitions). First remove a primary partition and create an extended partition."
-rw-r--r--perl-install/diskdrake/interactive.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 42e926834..2410e0df4 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -457,7 +457,18 @@ sub Create {
check($in, $hd, $part, $all_hds) or return 1;
$migrate_files = need_migration($in, $part->{mntpoint}) or return 1;
- fsedit::add($hd, $part, $all_hds, { force => 1, primaryOrExtended => $primaryOrExtended });
+ eval { fsedit::add($hd, $part, $all_hds, { force => 1, primaryOrExtended => $primaryOrExtended }) };
+ if (my $err = $@) {
+ if ($err =~ /raw_add/ && $hd->hasExtended && !$hd->{primary}{extended}) {
+ $in->ask_warn(_("Error"), _("You can't create a new partition
+(since you reached the maximal number of primary partitions).
+First remove a primary partition and create an extended partition."));
+ return 0;
+ } else {
+ $in->ask_warn(_("Error"), $@);
+ return 1;
+ }
+ }
0;
},
) or return;