summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mandriva.org>2009-01-22 10:37:15 +0000
committerPascal Terjan <pterjan@mandriva.org>2009-01-22 10:37:15 +0000
commit348c5f4eb2015dd237187cdb8fe71a98c16cf128 (patch)
treeeffdf7091761f8e63a3dbc6e91643380801fbd18 /perl-install/diskdrake
parent5f630d8e45cd49fa6086b36cc1e1e01916de928b (diff)
downloaddrakx-348c5f4eb2015dd237187cdb8fe71a98c16cf128.tar
drakx-348c5f4eb2015dd237187cdb8fe71a98c16cf128.tar.gz
drakx-348c5f4eb2015dd237187cdb8fe71a98c16cf128.tar.bz2
drakx-348c5f4eb2015dd237187cdb8fe71a98c16cf128.tar.xz
drakx-348c5f4eb2015dd237187cdb8fe71a98c16cf128.zip
don't rewrite label when it did not change (#47186)
Diffstat (limited to 'perl-install/diskdrake')
-rw-r--r--perl-install/diskdrake/interactive.pm5
1 files changed, 4 insertions, 1 deletions
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);