Mageia Bugzilla – Attachment 6578 Details for
Bug 5407
Diskdrake: suggest logical name from selected/entered mount point.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
slightly improved patch
5407.diff (text/plain), 1.57 KB, created by
Thierry Vignaud
on 2015-05-19 10:59:50 CEST
(
hide
)
Description:
slightly improved patch
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2015-05-19 10:59:50 CEST
Size:
1.57 KB
patch
obsolete
>diff -up ./diskdrake/interactive.pm.tv3 ./diskdrake/interactive.pm >--- ./diskdrake/interactive.pm.tv3 2015-05-19 04:51:20.361052169 -0400 >+++ ./diskdrake/interactive.pm 2015-05-19 04:56:24.760060056 -0400 >@@ -499,6 +499,10 @@ sub Create { > { label => N("Filesystem type: "), val => \$type_name, list => [ fs::type::type_names($::expert, $hd) ], > sort => 0, if_($::expert, gtk => { wrap_width => 2 }, do_not_ellipsize => 1) }, > { label => N("Mount point: "), val => \$part->{mntpoint}, list => [ fsedit::suggestions_mntpoint($all_hds), '' ], >+ if_(isLVM($hd), changed => sub { >+ undef $part->{lv_name}; >+ lvm::suggest_lv_name($hd, $part); >+ }), type => 'combo', not_edit => 0, > disabled => sub { my $p = fs::type::type_name2subpart($type_name); isSwap($p) || isNonMountable($p) }, type => 'combo', not_edit => 0, > }, > if_($::expert && $hd->hasExtended, >diff -up ./lvm.pm.tv3 ./lvm.pm >--- ./lvm.pm.tv3 2015-05-19 04:40:34.680035439 -0400 >+++ ./lvm.pm 2015-05-19 04:58:19.696063034 -0400 >@@ -226,14 +226,15 @@ sub suggest_lv_name_from_mnt_point { > $str = "root" if $str eq '/'; > $str =~ s!^/!!; > $str =~ s!/!_!g; >- $str; >+ $str =~ s! !_!g; >+ 'lv_' . $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); >+ $lv->{lv_name} ||= "lv_" . (1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list)); > } > > sub lv_create {
diff -up ./diskdrake/interactive.pm.tv3 ./diskdrake/interactive.pm --- ./diskdrake/interactive.pm.tv3 2015-05-19 04:51:20.361052169 -0400 +++ ./diskdrake/interactive.pm 2015-05-19 04:56:24.760060056 -0400 @@ -499,6 +499,10 @@ sub Create { { label => N("Filesystem type: "), val => \$type_name, list => [ fs::type::type_names($::expert, $hd) ], sort => 0, if_($::expert, gtk => { wrap_width => 2 }, do_not_ellipsize => 1) }, { label => N("Mount point: "), val => \$part->{mntpoint}, list => [ fsedit::suggestions_mntpoint($all_hds), '' ], + if_(isLVM($hd), changed => sub { + undef $part->{lv_name}; + lvm::suggest_lv_name($hd, $part); + }), type => 'combo', not_edit => 0, disabled => sub { my $p = fs::type::type_name2subpart($type_name); isSwap($p) || isNonMountable($p) }, type => 'combo', not_edit => 0, }, if_($::expert && $hd->hasExtended, diff -up ./lvm.pm.tv3 ./lvm.pm --- ./lvm.pm.tv3 2015-05-19 04:40:34.680035439 -0400 +++ ./lvm.pm 2015-05-19 04:58:19.696063034 -0400 @@ -226,14 +226,15 @@ sub suggest_lv_name_from_mnt_point { $str = "root" if $str eq '/'; $str =~ s!^/!!; $str =~ s!/!_!g; - $str; + $str =~ s! !_!g; + 'lv_' . $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); + $lv->{lv_name} ||= "lv_" . (1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list)); } sub lv_create {
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 5407
:
6577
| 6578