From 348c5f4eb2015dd237187cdb8fe71a98c16cf128 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Thu, 22 Jan 2009 10:37:15 +0000 Subject: don't rewrite label when it did not change (#47186) --- perl-install/diskdrake/interactive.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'perl-install/diskdrake') diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm index caf8547bc..eaf2c8db4 100644 --- a/perl-install/diskdrake/interactive.pm +++ b/perl-install/diskdrake/interactive.pm @@ -41,6 +41,7 @@ struct part { bool prefer_device_UUID # should the {device_UUID} or the {device} be used in fstab bool prefer_device # should the {device} be used in fstab bool faked_device # false if {device} is a real device, true for nfs/smb/dav/none devices. If the field does not exist, we do not know + bool device_LABEL_changed # true if device_LABEL is different from the one on the disk string rootDevice # 'sda', 'hdc' ... (can also be a VG_name) string real_mntpoint # directly on real /, '/tmp/hdimage' ... @@ -603,7 +604,7 @@ sub Type { sub Label { my ($in, $_hd, $part) = @_; - my $old_label = $part->{device_LABEL}; + my $old_label = $part->{device_LABEL} || ""; $in->ask_from(N("Set volume label"), N("Beware, this will be written to disk as soon as you validate!"), [ @@ -614,6 +615,8 @@ sub Label { $part->{device_LABEL} = $old_label; return; } + return if $old_label eq $part->{device_LABEL}; + $part->{device_LABEL_changed} = 1; $part->{prefer_device_LABEL} = to_bool($part->{device_LABEL}) && !isLVM($part); fs::format::clean_label($part); fs::format::write_label($part); -- cgit v1.2.1