From 31bc4d9569f2cc454ccb50cb6352b4afaa93c793 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 4 Feb 2009 11:20:43 +0000 Subject: diskdrake: forget the changed label when the user cancels --- perl-install/NEWS | 3 +++ perl-install/diskdrake/interactive.pm | 12 +++++------- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'perl-install') diff --git a/perl-install/NEWS b/perl-install/NEWS index 1a97fde58..20aac6bca 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- diskdrake: + o forget the changed label when the user cancels + Version 11.81 - 3 February 2009 - interactive::curses: diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index 838463204..e266d0443 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -611,18 +611,16 @@ sub Type { sub Label { my ($in, $_hd, $part) = @_; - my $old_label = $part->{device_LABEL} || ""; + my $new_label = $part->{device_LABEL} || ""; $in->ask_from(N("Set volume label"), N("Beware, this will be written to disk as soon as you validate!"), [ { label => N("Which volume label?"), title => 1 }, - { label => N("Label:"), val => \$part->{device_LABEL} } ]) or return; + { label => N("Label:"), val => \$new_label } ]) or return; - if (!fs::format::check_package_is_installed_label($in->do_pkgs, $part->{fs_type})) { - $part->{device_LABEL} = $old_label; - return; - } - return if $old_label eq $part->{device_LABEL}; + fs::format::check_package_is_installed_label($in->do_pkgs, $part->{fs_type}) or return; + return if $new_label eq $part->{device_LABEL}; + $part->{device_LABEL} = $new_label; $part->{device_LABEL_changed} = 1; $part->{prefer_device_LABEL} = to_bool($part->{device_LABEL}) && !isLVM($part); fs::format::clean_label($part); -- cgit v1.2.1