summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/hd_gtk.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-11-16 10:14:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-11-16 10:14:11 +0000
commitbfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6 (patch)
tree29fc62cbe16571e39431bc6b6eca9a6143e699fe /perl-install/diskdrake/hd_gtk.pm
parent81966041225bbca4aae4acf0cf141645dffedc03 (diff)
downloaddrakx-bfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6.tar
drakx-bfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6.tar.gz
drakx-bfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6.tar.bz2
drakx-bfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6.tar.xz
drakx-bfcc35f8882cb0fbd5c965a43ccd8103e38ed5e6.zip
create isEmpty() and use it instead of simply testing {pt_type}, since {pt_type} can be undef whereas {fs_type} is set
Diffstat (limited to 'perl-install/diskdrake/hd_gtk.pm')
-rw-r--r--perl-install/diskdrake/hd_gtk.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index 9de1dde04..d674d1e35 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -357,15 +357,15 @@ sub createOrChangeType {
{ pt_type => 0, start => 1, size => $hd->{totalsectors} - 1 };
$part or return;
if ($fs_type eq 'other') {
- $in->ask_warn('', N("Use ``%s'' instead", $part->{pt_type} ? N("Type") : N("Create")));
+ $in->ask_warn('', N("Use ``%s'' instead", isEmpty($part) ? N("Create") : N("Type")));
} elsif (!$fs_type) {
- $in->ask_warn('', N("Use ``%s'' instead", N("Delete"))) if $part->{pt_type};
- } elsif ($part->{pt_type}) {
- return if $fs_type eq $part->{fs_type};
- $in->ask_warn('', isBusy($part) ? N("Use ``Unmount'' first") : N("Use ``%s'' instead", N("Type")));
- } else {
+ $in->ask_warn('', N("Use ``%s'' instead", N("Delete"))) if !isEmpty($part);
+ } elsif (isEmpty($part)) {
fs::type::set_fs_type($part, $fs_type);
diskdrake::interactive::Create($in, $hd, $part, $all_hds);
+ } else {
+ return if $fs_type eq $part->{fs_type};
+ $in->ask_warn('', isBusy($part) ? N("Use ``Unmount'' first") : N("Use ``%s'' instead", N("Type")));
}
}