summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-07-01 06:28:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-07-01 06:28:04 +0000
commit63b12544ba16ec894591dc0b93b102e210f9e144 (patch)
tree2ec999bd7fedb30f85acdbf888f3bd3d46e31f55 /perl-install
parentc07b9537629ab23d80bc0e645127f57e0d0e197e (diff)
downloaddrakx-63b12544ba16ec894591dc0b93b102e210f9e144.tar
drakx-63b12544ba16ec894591dc0b93b102e210f9e144.tar.gz
drakx-63b12544ba16ec894591dc0b93b102e210f9e144.tar.bz2
drakx-63b12544ba16ec894591dc0b93b102e210f9e144.tar.xz
drakx-63b12544ba16ec894591dc0b93b102e210f9e144.zip
create generic function get_pv_field()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/lvm.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 165caa3ef..e21187a9f 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -63,10 +63,17 @@ sub check {
1;
}
+sub get_pv_field {
+ my ($pv, $field) = @_;
+ my $dev = expand_symlinks(devices::make($pv->{device}));
+ run_program::get_stdout('lvm2', 'pvs', '--noheadings', '--nosuffix', '-o', $field, $dev);
+}
+
sub pv_to_vg {
- my ($part) = @_;
- my $dev = expand_symlinks(devices::make($part->{device}));
- run_program::get_stdout('lvm2', 'pvs', '--noheadings', '-o', 'vg_name', $dev) =~ /(\S+)/ && $1;
+ my ($pv) = @_;
+ my $z = get_pv_field($pv, 'vg_name');
+ warn "$pv->{device} $z\n";
+ $z =~ /(\S+)/ && $1;
}
sub update_size {