diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-01-20 19:12:12 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-01-20 19:12:12 +0000 |
commit | a401a56c2b62781b093d6e63c9ba132d51d99c0b (patch) | |
tree | c84eec00048b03e5ccb642f4b306ed70113ab399 /perl-install | |
parent | ae944fecc4941fc7a8e5a283c4c9de163d779abb (diff) | |
download | drakx-backup-do-not-use-a401a56c2b62781b093d6e63c9ba132d51d99c0b.tar drakx-backup-do-not-use-a401a56c2b62781b093d6e63c9ba132d51d99c0b.tar.gz drakx-backup-do-not-use-a401a56c2b62781b093d6e63c9ba132d51d99c0b.tar.bz2 drakx-backup-do-not-use-a401a56c2b62781b093d6e63c9ba132d51d99c0b.tar.xz drakx-backup-do-not-use-a401a56c2b62781b093d6e63c9ba132d51d99c0b.zip |
(suggest_lv_name_from_mnt_point, suggest_lv_name) suggest better LV
names based on the mount point rather than numbers
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/install/NEWS | 1 | ||||
-rw-r--r-- | perl-install/lvm.pm | 10 |
3 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index ea7eae76c..d657872f7 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,5 +1,6 @@ - diskdrake: o enable to set LV names when not in expert mode + o suggest better LV names based on the mount point rather than numbers Version 13.74 - 24 December 2011 diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS index 07ae7d403..48d9da05d 100644 --- a/perl-install/install/NEWS +++ b/perl-install/install/NEWS @@ -1,6 +1,7 @@ - include gtk20 translations (caps lock & the like) - diskdrake: o enable to set LV names when not in expert mode + o suggest better LV names based on the mount point rather than numbers Version 13.75.1 - 19 January 2012 diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm index a8837c91a..3a2667191 100644 --- a/perl-install/lvm.pm +++ b/perl-install/lvm.pm @@ -169,9 +169,19 @@ sub lv_delete { @$list = grep { $_ != $lv } @$list; } +sub suggest_lv_name_from_mnt_point { + my ($lv) = @_; + my $str = $lv->{mntpoint}; + $str = "root" if $str eq '/'; + $str =~ s!^/!!; + $str =~ s!/!_!g; + $str; +} + sub suggest_lv_name { my ($lvm, $lv) = @_; my $list = $lvm->{primary}{normal} ||= []; + $lv->{lv_name} ||= suggest_lv_name_from_mnt_point($lv); $lv->{lv_name} ||= 1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list); } |