From 49efec557b1339fa90bec3b6b3edbb6023595ed3 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 29 Jul 2002 20:34:31 +0000 Subject: 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." --- perl-install/diskdrake/interactive.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'perl-install/diskdrake') 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; -- cgit v1.2.1