diff -Nurb liblinux-lvm-perl-0.13/Changes liblinux-lvm-perl-0.14/Changes --- liblinux-lvm-perl-0.13/Changes 2003-04-10 18:18:39.000000000 +0530 +++ liblinux-lvm-perl-0.14/Changes 2008-07-02 13:24:21.000000000 +0530 @@ -14,7 +14,11 @@ - Added some basic error checking. 0.13 Mon Apr 10 07:45:00 2003 - - Reworked some of the regule expressions. + - Reworked some of the regular expressions. - Improved the source documentation. - Added some examples of how to use the module. +0.14 Wed Jul 2 02:54:14 CDT 2008 + - Fixed some logic errors to get it working a little better + - Full rewrite underway + diff -Nurb liblinux-lvm-perl-0.13/debian/changelog liblinux-lvm-perl-0.14/debian/changelog --- liblinux-lvm-perl-0.13/debian/changelog 2008-09-07 19:05:54.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/changelog 2008-09-07 19:07:50.000000000 +0530 @@ -1,3 +1,23 @@ +liblinux-lvm-perl (0.14-1) unstable; urgency=low + + [ Jeremiah C. Foster ] + * New upstream release (Closes: #488205) + + [ David Bremner ] + * Remove obsolete patch for whitespace in command output (fixed upstream) + * Patch /usr/sbin paths to /sbin + * Add myself to uploaders + * Add lvm2 to Recommends + * Fix broken long/short description + + [ gregor herrmann ] + * Set Standards-Version to 3.8.0. + * Add debian/README.source to document quilt usage, as required by + Debian Policy since 3.8.0. + * debian/copyright: update year of copyright. + + -- David Bremner Thu, 28 Aug 2008 14:54:50 +0000 + liblinux-lvm-perl (0.13-2) unstable; urgency=low * Added myself as an uploader diff -Nurb liblinux-lvm-perl-0.13/debian/control liblinux-lvm-perl-0.14/debian/control --- liblinux-lvm-perl-0.13/debian/control 2008-09-07 19:05:54.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/control 2008-09-07 19:07:50.000000000 +0530 @@ -4,8 +4,8 @@ Build-Depends: debhelper (>= 5.0.0), quilt Build-Depends-Indep: perl (>= 5.8.8-11.1) Maintainer: Debian Perl Group -Uploaders: Jeremiah C. Foster , Gunnar Wolf -Standards-Version: 3.7.3 +Uploaders: Jeremiah C. Foster , Gunnar Wolf , David Bremner +Standards-Version: 3.8.0 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/liblinux-lvm-perl/ Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/liblinux-lvm-perl/ Homepage: http://search.cpan.org/dist/Linux::LVM/ @@ -13,5 +13,7 @@ Package: liblinux-lvm-perl Architecture: all Depends: ${perl:Depends} -Description: Perl extension for accessing Logical Volume Manager(LVM) - data structures on Linux. +Recommends: lvm2 +Description: module to access LVM status information in perl scripts + Linux::LVM parses the output from vgdisplay, pvdisplay, and lvdisplay and + makes it available as a Perl hash. diff -Nurb liblinux-lvm-perl-0.13/debian/copyright liblinux-lvm-perl-0.14/debian/copyright --- liblinux-lvm-perl-0.13/debian/copyright 2008-09-07 19:05:54.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/copyright 2008-09-07 19:07:50.000000000 +0530 @@ -6,7 +6,7 @@ The upstream author is: Chad Kerner, . -Copyright (c) 2003 Chad Kerner +Copyright (c) 2008 Chad Kerner This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nurb liblinux-lvm-perl-0.13/debian/patches/binaries_in_sbin liblinux-lvm-perl-0.14/debian/patches/binaries_in_sbin --- liblinux-lvm-perl-0.13/debian/patches/binaries_in_sbin 1970-01-01 05:30:00.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/patches/binaries_in_sbin 2008-09-07 19:07:50.000000000 +0530 @@ -0,0 +1,35 @@ +--- liblinux-lvm-perl.orig/LVM.pm ++++ liblinux-lvm-perl/LVM.pm +@@ -151,8 +151,8 @@ + my $lvn; + my $pvn; + +- if( ! -e "/usr/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } +- my @vginfo = `/usr/sbin/vgdisplay -v`; ++ if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } ++ my @vginfo = `/sbin/vgdisplay -v`; + + VGINF: foreach(@vginfo) { + chomp; +@@ -361,8 +361,8 @@ + my %pvhash; + + if( ! -e "$pvname" ) { die("Physical Disk: $pvname does not exist."); } +- if( ! -e "/usr/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } +- my @pvinfo = `/usr/sbin/pvdisplay $pvname`; ++ if( ! -e "/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } ++ my @pvinfo = `/sbin/pvdisplay $pvname`; + + PVINF: foreach(@pvinfo) { + # Get the name of the physical volume. +@@ -445,8 +445,8 @@ + my $lvname = $_[0]; + my %lvhash; + if( ! -e "$lvname" ) { die("Logical Disk: $lvname does not exist."); } +- if( ! -e "/usr/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } +- my @lvinfo = `/usr/sbin/lvdisplay $lvname`; ++ if( ! -e "/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } ++ my @lvinfo = `/sbin/lvdisplay $lvname`; + + LVINF: foreach(@lvinfo) { + diff -Nurb liblinux-lvm-perl-0.13/debian/patches/process_whitespace_in_command_output liblinux-lvm-perl-0.14/debian/patches/process_whitespace_in_command_output --- liblinux-lvm-perl-0.13/debian/patches/process_whitespace_in_command_output 2008-09-07 19:05:54.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/patches/process_whitespace_in_command_output 1970-01-01 05:30:00.000000000 +0530 @@ -1,360 +0,0 @@ -Index: liblinux-lvm-perl/LVM.pm -=================================================================== ---- liblinux-lvm-perl.orig/LVM.pm 2008-05-26 11:52:05.000000000 -0500 -+++ liblinux-lvm-perl/LVM.pm 2008-05-26 11:53:06.000000000 -0500 -@@ -157,169 +157,169 @@ - VGINF: foreach(@vginfo) { - - # Parse the volume group name. -- if( m/^VG Name\s+(\S+)/ ) { -+ if( m/^\s*VG Name\s+(\S+)/ ) { - $vgn = $1; $vghash{$vgn}->{vgname} = $1; - next VGINF; } - - # Parse the volume group access. -- elsif( m/^VG Access\s+(\S+)/ ) { -+ elsif( m/^\s*VG Access\s+(\S+)/ ) { - $vghash{$vgn}->{access} = $1; - next VGINF; } - - # Parse the volume group status. -- elsif( m/^VG Status\s+(.+)/ ) { -+ elsif( m/^\s*VG Status\s+(.+)/ ) { - $vghash{$vgn}->{status} = $1; - next VGINF; } - - # Parse the volume group number. -- elsif( m/^VG #\s+(\S+)/ ) { -+ elsif( m/^\s*VG #\s+(\S+)/ ) { - $vghash{$vgn}->{vg_number} = $1; - next VGINF; } - - # Parse the maximum logical volume size and size unit for the volume group. -- elsif( m/^MAX LV Size\s+(\S+) (\S+)/ ) { -+ elsif( m/^\s*MAX LV Size\s+(\S+) (\S+)/ ) { - $vghash{$vgn}->{max_lv_size} = $1; - $vghash{$vgn}->{max_lv_size_unit} = $2; - next VGINF; } - - # Parse the maximum number of logical volumes for the volume group. -- elsif( m/^MAX LV\s+(\S+)/ ) { -+ elsif( m/^\s*MAX LV\s+(\S+)/ ) { - $vghash{$vgn}->{max_lv} = $1; - next VGINF; } - - # Parse the current number of logical volumes for the volume group. -- elsif( m/^Cur LV\s+(\S+)/ ) { -+ elsif( m/^\s*Cur LV\s+(\S+)/ ) { - $vghash{$vgn}->{cur_lv} = $1; - next VGINF; } - - # Parse the number of open logical volumes for the volume group. -- elsif( m/^Open LV\s+(\S+)/ ) { -+ elsif( m/^\s*Open LV\s+(\S+)/ ) { - $vghash{$vgn}->{open_lv} = $1; - next VGINF; } - - # Parse the number of physical volumes accessible to the volume group. -- elsif( m/^Max PV\s+(\S+)/ ) { -+ elsif( m/^\s*Max PV\s+(\S+)/ ) { - $vghash{$vgn}->{max_pv} = $1; - next VGINF; } - - # Parse the current number of physical volumes in the volume group. -- elsif( m/^Cur PV\s+(\S+)/ ) { -+ elsif( m/^\s*Cur PV\s+(\S+)/ ) { - $vghash{$vgn}->{cur_pv} = $1; - next VGINF; } - - # Parse the number of active physical volumes in the volume group. -- elsif( m/^Act PV\s+(\S+)/ ) { -+ elsif( m/^\s*Act PV\s+(\S+)/ ) { - $vghash{$vgn}->{act_pv} = $1; - next VGINF; } - - # Parse the size of the volume group. -- elsif( m/^VG Size\s+(\S+) (\S+)/ ) { -+ elsif( m/^\s*VG Size\s+(\S+) (\S+)/ ) { - $vghash{$vgn}->{vg_size} = $1; - $vghash{$vgn}->{vg_size_unit} = $2; - next VGINF; } - - # Parse the physical extent size and unit for one extent of volume group. -- elsif( m/^PE Size\s+(\S+) (\S+)/ ) { -+ elsif( m/^\s*PE Size\s+(\S+) (\S+)/ ) { - $vghash{$vgn}->{pe_size} = $1; - $vghash{$vgn}->{pe_size_unit} = $2; - next VGINF; } - - # Parse the total number and number of free physical extents from the physical disk. -- elsif( m/^Total PE \/ Free PE\s+(\S+) \/ (\S+)/m ) { -+ elsif( m/^\s*Total PE \/ Free PE\s+(\S+) \/ (\S+)/m ) { - $vghash{$vgn}->{pvols}->{$pvn}->{total_pe} = $1; - $vghash{$vgn}->{pvols}->{$pvn}->{free_pe} = $2; - next VGINF; } - - # Parse the total number of physical extents from the volume group. -- elsif( m/^Total PE\s+(\S+)/ ) { -+ elsif( m/^\s*Total PE\s+(\S+)/ ) { - $vghash{$vgn}->{total_pe} = $1; - next VGINF; } - - # Parse the number of allocated physical extents from the volume group. -- elsif( m/^Alloc PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { -+ elsif( m/^\s*Alloc PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { - $vghash{$vgn}->{alloc_pe} = $1; - $vghash{$vgn}->{alloc_pe_size} = $2; - $vghash{$vgn}->{alloc_pe_size_unit} = $3; - next VGINF; } - - # Parse the volume group name. -- elsif( m/^Free PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { -+ elsif( m/^\s*Free PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { - $vghash{$vgn}->{free_pe} = $1; - $vghash{$vgn}->{free_pe_size} = $2; - $vghash{$vgn}->{free_pe_size_unit} = $3; - next VGINF; } - - # Parse the volume group uuid. -- elsif( m/^VG UUID\s+(\S+)/ ) { -+ elsif( m/^\s*VG UUID\s+(\S+)/ ) { - $vghash{$vgn}->{uuid} = $1; - next VGINF; } - - # Parse the logical volume name. -- elsif( m/^LV Name\s+(\S+)/ ) { -+ elsif( m/^\s*LV Name\s+(\S+)/ ) { - $lvn = $1; - $vghash{$vgn}->{lvols}->{$lvn}->{name} = $1; - next VGINF; } - - # Parse the logical volume size and unit. -- elsif( m/^LV Size\s+(\S+) (\S+)/ ) { -+ elsif( m/^\s*LV Size\s+(\S+) (\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{lv_size} = $1; - $vghash{$vgn}->{lvols}->{$lvn}->{lv_size_unit} = $2; - next VGINF; } - - # Parse the logical volume write access. -- elsif( m/^LV Write Access\s+(\S+)/ ) { -+ elsif( m/^\s*LV Write Access\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{write_access} = $1; - next VGINF; } - - # Parse the logical volume status. -- elsif( m/^LV Status\s+(.+)/ ) { -+ elsif( m/^\s*LV Status\s+(.+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{status} = $1; - next VGINF; } - - # Parse the number of logical extents in the logical volume. -- elsif( m/^Current LE\s+(\S+)/ ) { -+ elsif( m/^\s*Current LE\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{cur_le} = $1; - next VGINF; } - - # Parse the number of allocated logical extents in the logical volume. -- elsif( m/^Allocated LE\s+(\S+)/ ) { -+ elsif( m/^\s*Allocated LE\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{alloc_le} = $1; - next VGINF; } - - # Parse the allocation type for the logical volume. -- elsif( m/^Allocation\s+(.+)/ ) { -+ elsif( m/^\s*Allocation\s+(.+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{allocation} = $1; - next VGINF; } - - # Parse the volume number. -- elsif( m/^LV #\s+(\S+)/ ) { -+ elsif( m/^\s*LV #\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{lv_number} = $1; - next VGINF; } - - # Parse the number of times the logical volume is open. -- elsif( m/^# open\s+(\S+)/ ) { -+ elsif( m/^\s*# open\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{open_lv} = $1; - next VGINF; } - - # Parse the block device of the logical volume. -- elsif( m/^Block device\s+(\S+)/ ) { -+ elsif( m/^\s*Block device\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{device} = $1; - next VGINF; } - - # Parse the value for the read ahead sectors of the logical volume. -- elsif( m/^Read ahead sectors\s+(\S+)/ ) { -+ elsif( m/^\s*Read ahead sectors\s+(\S+)/ ) { - $vghash{$vgn}->{lvols}->{$lvn}->{read_ahead} = $1; - next VGINF; } - - # Parse the physical disk name. -- elsif( m/^PV Name \(\#\)\s+(\S+) \((\S)\)/ ) { -+ elsif( m/^\s*PV Name \(\#\)\s+(\S+) \((\S)\)/ ) { - $pvn = $2; - $vghash{$vgn}->{pvols}->{$pvn}->{device} = $1; - $vghash{$vgn}->{pvols}->{$pvn}->{pv_number} = $2; - next VGINF; } - - # Parse the status of the physical disk. -- elsif( m/^PV Status\s+(.+)/ ) { -+ elsif( m/^\s*PV Status\s+(.+)/ ) { - $vghash{$vgn}->{pvols}->{$pvn}->{status} = $1; - next VGINF; } - } -@@ -347,17 +347,17 @@ - - PVINF: foreach(@pvinfo) { - # Get the name of the physical volume. -- if( m/^PV Name\s+(\S+)/ ) { -+ if( m/^\s*PV Name\s+(\S+)/ ) { - $pvhash{pv_name} = $1; - next PVINF; } - - # Get the name of the volume group the physical volume belongs to. -- if( m/^VG Name\s+(\S+)/ ) { -+ if( m/^\s*VG Name\s+(\S+)/ ) { - $pvhash{vg_name} = $1; - next PVINF; } - - # Get the size information of the physical volume. -- if( m/^PV Size\s+(\S+) (\S+) \[(\S+) secs\] \/ (.+)/ ) { -+ if( m/^\s*PV Size\s+(\S+) (\S+) \[(\S+) secs\] \/ (.+)/ ) { - $pvhash{size} = $1; - $pvhash{size_unit} = $2; - $pvhash{sectors} = $3; -@@ -365,48 +365,48 @@ - next PVINF; } - - # Get the physical volume number. -- if( m/^PV\#\s+(\S+)/ ) { -+ if( m/^\s*PV\#\s+(\S+)/ ) { - $pvhash{pv_number} = $1; - next PVINF; } - - # Get the status of the physical volume. -- if( m/^PV Status\s+(.+)/ ) { -+ if( m/^\s*PV Status\s+(.+)/ ) { - $pvhash{status} = $1; - next PVINF; } - - # Get the allocation status of the physical volume. -- if( m/^Allocatable\s+(.+)/ ) { -+ if( m/^\s*Allocatable\s+(.+)/ ) { - $pvhash{allocatable} = $1; - next PVINF; } - - # Get the number of logical volumes on the physical volume. -- if( m/^Cur LV\s+(\S+)/ ) { -+ if( m/^\s*Cur LV\s+(\S+)/ ) { - $pvhash{num_lvols} = $1; - next PVINF; } - - # Get the physical extent size and unit of the physical volume. -- if( m/^PE Size \((\S+)\)\s+(\S+)/ ) { -+ if( m/^\s*PE Size \((\S+)\)\s+(\S+)/ ) { - $pvhash{pe_size} = $2; - $pvhash{pe_size_unit} = $1; - next PVINF; } - - # Get the total numver of physical extents on the physical volume. -- if( m/^Total PE\s+(\S+)/ ) { -+ if( m/^\s*Total PE\s+(\S+)/ ) { - $pvhash{total_pe} = $1; - next PVINF; } - - # Get the number of free extents on the physical volume. -- if( m/^Free PE\s+(\S+)/ ) { -+ if( m/^\s*Free PE\s+(\S+)/ ) { - $pvhash{free_pe} = $1; - next PVINF; } - - # Get the number of allocated physical extents on the physical volume. -- if( m/^Allocated PE\s+(\S+)/ ) { -+ if( m/^\s*Allocated PE\s+(\S+)/ ) { - $pvhash{alloc_pe} = $1; - next PVINF; } - - # Get the UUID of the physical volume. -- if( m/^PV UUID\s+(\S+)/ ) { -+ if( m/^\s*PV UUID\s+(\S+)/ ) { - $pvhash{uuid} = $1; - next PVINF; } - } -@@ -434,63 +434,63 @@ - LVINF: foreach(@lvinfo) { - - # Get the logical volume name. -- if( m/^LV Name\s+(\S+)/ ) { -+ if( m/^\s*LV Name\s+(\S+)/ ) { - $lvhash{lv_name} = $1; - next LVINF; } - - # Get the volume group name. -- if( m/^VG Name\s+(\S+)/ ) { -+ if( m/^\s*VG Name\s+(\S+)/ ) { - $lvhash{vg_name} = $1; - next LVINF; } - - # Get the logical volume write status. -- if( m/^LV Write Access\s+(.+)/ ) { -+ if( m/^\s*LV Write Access\s+(.+)/ ) { - $lvhash{access} = $1; - next LVINF; } - - # Get the logical volume status. -- if( m/^LV Status\s+(.+)/ ) { -+ if( m/^\s*LV Status\s+(.+)/ ) { - $lvhash{status} = $1; - next LVINF; } - - # Get the logical volume number. -- if( m/^LV \#\s+(\S+)/ ) { -+ if( m/^\s*LV \#\s+(\S+)/ ) { - $lvhash{lv_number} = $1; - next LVINF; } - - # Get the number of opens for the logical volume. -- if( m/^\# open\s+(\S+)/ ) { -+ if( m/^\s*\# open\s+(\S+)/ ) { - $lvhash{lv_open} = $1; - next LVINF; } - - # Get the logical volume size and size unit. -- if( m/^LV Size\s+(\S+) (\S+)/ ) { -+ if( m/^\s*LV Size\s+(\S+) (\S+)/ ) { - $lvhash{size} = $1; - $lvhash{size_unit} = $2; - next LVINF; } - - # Get the number of extents assigned to the logical volume. -- if( m/^Current LE\s+(\S+)/ ) { -+ if( m/^\s*Current LE\s+(\S+)/ ) { - $lvhash{current_le} = $1; - next LVINF; } - - # Get the number of extents allocated to the logical volume. -- if( m/^Allocated LE\s+(\S+)/ ) { -+ if( m/^\s*Allocated LE\s+(\S+)/ ) { - $lvhash{alloc_le} = $1; - next LVINF; } - - # Get the extent allocation type of the logical volume. -- if( m/^Allocation\s+(.+)/ ) { -+ if( m/^\s*Allocation\s+(.+)/ ) { - $lvhash{allocation} = $1; - next LVINF; } - - # Get the number of read ahead sectors for the logical volume. -- if( m/^Read ahead sectors\s+(\S+)/ ) { -+ if( m/^\s*Read ahead sectors\s+(\S+)/ ) { - $lvhash{read_ahead} = $1; - next LVINF; } - - # Get the block device of the logical volume. -- if( m/^Block device\s+(\S+)/ ) { -+ if( m/^\s*Block device\s+(\S+)/ ) { - $lvhash{block_device} = $1; - next LVINF; } - } diff -Nurb liblinux-lvm-perl-0.13/debian/patches/series liblinux-lvm-perl-0.14/debian/patches/series --- liblinux-lvm-perl-0.13/debian/patches/series 2008-09-07 19:05:54.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/patches/series 2008-09-07 19:07:50.000000000 +0530 @@ -1 +1 @@ -process_whitespace_in_command_output +binaries_in_sbin diff -Nurb liblinux-lvm-perl-0.13/debian/README.source liblinux-lvm-perl-0.14/debian/README.source --- liblinux-lvm-perl-0.13/debian/README.source 1970-01-01 05:30:00.000000000 +0530 +++ liblinux-lvm-perl-0.14/debian/README.source 2008-09-07 19:07:50.000000000 +0530 @@ -0,0 +1,5 @@ +This package uses quilt to manage all modifications to the upstream +source. Changes are stored in the source package as diffs in +debian/patches and applied during the build. + +See /usr/share/doc/quilt/README.source for a detailed explanation. diff -Nurb liblinux-lvm-perl-0.13/examples/get_lv_info.pl liblinux-lvm-perl-0.14/examples/get_lv_info.pl --- liblinux-lvm-perl-0.13/examples/get_lv_info.pl 2003-04-10 18:15:53.000000000 +0530 +++ liblinux-lvm-perl-0.14/examples/get_lv_info.pl 2007-10-26 00:37:24.000000000 +0530 @@ -1,7 +1,7 @@ use Linux::LVM; -%hash = get_lv_info("/dev/vg00/code"); +%hash = get_lv_info("/dev/vg00/software"); foreach(sort keys %hash) { print "$_ = $hash{$_} \n"; diff -Nurb liblinux-lvm-perl-0.13/examples/get_pv_info.pl liblinux-lvm-perl-0.14/examples/get_pv_info.pl --- liblinux-lvm-perl-0.13/examples/get_pv_info.pl 2003-04-10 18:17:13.000000000 +0530 +++ liblinux-lvm-perl-0.14/examples/get_pv_info.pl 2008-03-02 08:12:47.000000000 +0530 @@ -1,7 +1,10 @@ use Linux::LVM; +use Data::Dumper; -%hash = get_pv_info("/dev/hdb"); +%hash = get_pv_info("/dev/hdd1"); + +print Dumper(\%hash); foreach(sort keys %hash) { print "$_ = $hash{$_} \n"; diff -Nurb liblinux-lvm-perl-0.13/LVM.pm liblinux-lvm-perl-0.14/LVM.pm --- liblinux-lvm-perl-0.13/LVM.pm 2003-04-10 01:25:57.000000000 +0530 +++ liblinux-lvm-perl-0.14/LVM.pm 2008-07-02 13:23:41.000000000 +0530 @@ -36,7 +36,7 @@ get_lv_info ); -our $VERSION = '0.13'; +our $VERSION = '0.14'; # Preloaded methods go here. @@ -151,177 +151,196 @@ my $lvn; my $pvn; - if( ! -e "/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @vginfo = `/sbin/vgdisplay -v`; + if( ! -e "/usr/sbin/vgdisplay" ) { die("LVM utilities not installed in /sbin"); } + my @vginfo = `/usr/sbin/vgdisplay -v`; VGINF: foreach(@vginfo) { + chomp; + s/^\s+//g; + s/\s+$//g; + next VGINF if m/^$/; # Parse the volume group name. - if( m/^VG Name\s+(\S+)/ ) { + if( m/VG Name\s+(\S+)/ ) { $vgn = $1; $vghash{$vgn}->{vgname} = $1; next VGINF; } # Parse the volume group access. - elsif( m/^VG Access\s+(\S+)/ ) { + elsif( m/VG Access\s+(\S+)/ ) { $vghash{$vgn}->{access} = $1; next VGINF; } # Parse the volume group status. - elsif( m/^VG Status\s+(.+)/ ) { + elsif( m/VG Status\s+(.+)/ ) { $vghash{$vgn}->{status} = $1; next VGINF; } # Parse the volume group number. - elsif( m/^VG #\s+(\S+)/ ) { + elsif( m/VG #\s+(\S+)/ ) { $vghash{$vgn}->{vg_number} = $1; next VGINF; } # Parse the maximum logical volume size and size unit for the volume group. - elsif( m/^MAX LV Size\s+(\S+) (\S+)/ ) { + elsif( m/MAX LV Size\s+(\S+) (\S+)/ ) { $vghash{$vgn}->{max_lv_size} = $1; $vghash{$vgn}->{max_lv_size_unit} = $2; next VGINF; } # Parse the maximum number of logical volumes for the volume group. - elsif( m/^MAX LV\s+(\S+)/ ) { + elsif( m/MAX LV\s+(\S+)/ ) { $vghash{$vgn}->{max_lv} = $1; next VGINF; } # Parse the current number of logical volumes for the volume group. - elsif( m/^Cur LV\s+(\S+)/ ) { + elsif( m/Cur LV\s+(\S+)/ ) { $vghash{$vgn}->{cur_lv} = $1; next VGINF; } # Parse the number of open logical volumes for the volume group. - elsif( m/^Open LV\s+(\S+)/ ) { + elsif( m/Open LV\s+(\S+)/ ) { $vghash{$vgn}->{open_lv} = $1; next VGINF; } # Parse the number of physical volumes accessible to the volume group. - elsif( m/^Max PV\s+(\S+)/ ) { + elsif( m/Max PV\s+(\S+)/ ) { $vghash{$vgn}->{max_pv} = $1; next VGINF; } # Parse the current number of physical volumes in the volume group. - elsif( m/^Cur PV\s+(\S+)/ ) { + elsif( m/Cur PV\s+(\S+)/ ) { $vghash{$vgn}->{cur_pv} = $1; next VGINF; } # Parse the number of active physical volumes in the volume group. - elsif( m/^Act PV\s+(\S+)/ ) { + elsif( m/Act PV\s+(\S+)/ ) { $vghash{$vgn}->{act_pv} = $1; next VGINF; } # Parse the size of the volume group. - elsif( m/^VG Size\s+(\S+) (\S+)/ ) { + elsif( m/VG Size\s+(\S+) (\S+)/ ) { $vghash{$vgn}->{vg_size} = $1; $vghash{$vgn}->{vg_size_unit} = $2; next VGINF; } # Parse the physical extent size and unit for one extent of volume group. - elsif( m/^PE Size\s+(\S+) (\S+)/ ) { + elsif( m/PE Size\s+(\S+) (\S+)/ ) { $vghash{$vgn}->{pe_size} = $1; $vghash{$vgn}->{pe_size_unit} = $2; next VGINF; } # Parse the total number and number of free physical extents from the physical disk. - elsif( m/^Total PE \/ Free PE\s+(\S+) \/ (\S+)/m ) { + elsif( m/Total PE \/ Free PE\s+(\S+) \/ (\S+)/m ) { $vghash{$vgn}->{pvols}->{$pvn}->{total_pe} = $1; $vghash{$vgn}->{pvols}->{$pvn}->{free_pe} = $2; next VGINF; } # Parse the total number of physical extents from the volume group. - elsif( m/^Total PE\s+(\S+)/ ) { + elsif( m/Total PE\s+(\S+)/ ) { $vghash{$vgn}->{total_pe} = $1; next VGINF; } # Parse the number of allocated physical extents from the volume group. - elsif( m/^Alloc PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { + elsif( m/Alloc PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { $vghash{$vgn}->{alloc_pe} = $1; $vghash{$vgn}->{alloc_pe_size} = $2; $vghash{$vgn}->{alloc_pe_size_unit} = $3; next VGINF; } # Parse the volume group name. - elsif( m/^Free PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { + elsif( m/Free PE \/ Size\s+(\S+) \/ (\S+) (\S+)/ ) { $vghash{$vgn}->{free_pe} = $1; $vghash{$vgn}->{free_pe_size} = $2; $vghash{$vgn}->{free_pe_size_unit} = $3; next VGINF; } # Parse the volume group uuid. - elsif( m/^VG UUID\s+(\S+)/ ) { + elsif( m/VG UUID\s+(\S+)/ ) { $vghash{$vgn}->{uuid} = $1; next VGINF; } # Parse the logical volume name. - elsif( m/^LV Name\s+(\S+)/ ) { + elsif( m/LV Name\s+(\S+)/ ) { $lvn = $1; $vghash{$vgn}->{lvols}->{$lvn}->{name} = $1; next VGINF; } + # Parse the logical volume UUID. + elsif( m/LV UUID\s+(\S+)/ ) { + $vghash{$vgn}->{lvols}->{$lvn}->{uuid} = $1; + next VGINF; } + + # Parse the logical volume UUID. + elsif( m/Segments\s+(\S+)/ ) { + $vghash{$vgn}->{lvols}->{$lvn}->{segments} = $1; + next VGINF; } + # Parse the logical volume size and unit. - elsif( m/^LV Size\s+(\S+) (\S+)/ ) { + elsif( m/LV Size\s+(\S+) (\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{lv_size} = $1; $vghash{$vgn}->{lvols}->{$lvn}->{lv_size_unit} = $2; next VGINF; } # Parse the logical volume write access. - elsif( m/^LV Write Access\s+(\S+)/ ) { + elsif( m/LV Write Access\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{write_access} = $1; next VGINF; } # Parse the logical volume status. - elsif( m/^LV Status\s+(.+)/ ) { + elsif( m/LV Status\s+(.+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{status} = $1; next VGINF; } # Parse the number of logical extents in the logical volume. - elsif( m/^Current LE\s+(\S+)/ ) { + elsif( m/Current LE\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{cur_le} = $1; next VGINF; } # Parse the number of allocated logical extents in the logical volume. - elsif( m/^Allocated LE\s+(\S+)/ ) { + elsif( m/Allocated LE\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{alloc_le} = $1; next VGINF; } # Parse the allocation type for the logical volume. - elsif( m/^Allocation\s+(.+)/ ) { + elsif( m/Allocation\s+(.+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{allocation} = $1; next VGINF; } # Parse the volume number. - elsif( m/^LV #\s+(\S+)/ ) { + elsif( m/LV #\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{lv_number} = $1; next VGINF; } # Parse the number of times the logical volume is open. - elsif( m/^# open\s+(\S+)/ ) { + elsif( m/# open\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{open_lv} = $1; next VGINF; } # Parse the block device of the logical volume. - elsif( m/^Block device\s+(\S+)/ ) { + elsif( m/Block device\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{device} = $1; next VGINF; } # Parse the value for the read ahead sectors of the logical volume. - elsif( m/^Read ahead sectors\s+(\S+)/ ) { + elsif( m/Read ahead sectors\s+(\S+)/ ) { $vghash{$vgn}->{lvols}->{$lvn}->{read_ahead} = $1; next VGINF; } # Parse the physical disk name. - elsif( m/^PV Name \(\#\)\s+(\S+) \((\S)\)/ ) { - $pvn = $2; + elsif( m/PV Name\s+(\S+)/ ) { + $pvn = $1; $vghash{$vgn}->{pvols}->{$pvn}->{device} = $1; - $vghash{$vgn}->{pvols}->{$pvn}->{pv_number} = $2; next VGINF; } # Parse the status of the physical disk. - elsif( m/^PV Status\s+(.+)/ ) { + elsif( m/PV Status\s+(.+)/ ) { $vghash{$vgn}->{pvols}->{$pvn}->{status} = $1; next VGINF; } + + # Parse the status of the physical disk. + elsif( m/PV UUID\s+(.+)/ ) { + $vghash{$vgn}->{pvols}->{$pvn}->{uuid} = $1; + next VGINF; } + } return %vghash; } # End of the get_vg_information routine. @@ -342,71 +361,69 @@ my %pvhash; if( ! -e "$pvname" ) { die("Physical Disk: $pvname does not exist."); } - if( ! -e "/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @pvinfo = `/sbin/pvdisplay $pvname`; + if( ! -e "/usr/sbin/pvdisplay" ) { die("LVM utilities not installed in /sbin"); } + my @pvinfo = `/usr/sbin/pvdisplay $pvname`; PVINF: foreach(@pvinfo) { # Get the name of the physical volume. - if( m/^PV Name\s+(\S+)/ ) { + if( m/PV Name\s+(\S+)/ ) { $pvhash{pv_name} = $1; next PVINF; } # Get the name of the volume group the physical volume belongs to. - if( m/^VG Name\s+(\S+)/ ) { + if( m/VG Name\s+(\S+)/ ) { $pvhash{vg_name} = $1; next PVINF; } # Get the size information of the physical volume. - if( m/^PV Size\s+(\S+) (\S+) \[(\S+) secs\] \/ (.+)/ ) { + if( m/PV Size\s+(\S+) (\S+)/ ) { $pvhash{size} = $1; $pvhash{size_unit} = $2; - $pvhash{sectors} = $3; - $pvhash{size_info} = $4; next PVINF; } # Get the physical volume number. - if( m/^PV\#\s+(\S+)/ ) { + if( m/PV\#\s+(\S+)/ ) { $pvhash{pv_number} = $1; next PVINF; } # Get the status of the physical volume. - if( m/^PV Status\s+(.+)/ ) { + if( m/PV Status\s+(.+)/ ) { $pvhash{status} = $1; next PVINF; } # Get the allocation status of the physical volume. - if( m/^Allocatable\s+(.+)/ ) { + if( m/Allocatable\s+(.+)/ ) { $pvhash{allocatable} = $1; next PVINF; } # Get the number of logical volumes on the physical volume. - if( m/^Cur LV\s+(\S+)/ ) { + if( m/Cur LV\s+(\S+)/ ) { $pvhash{num_lvols} = $1; next PVINF; } # Get the physical extent size and unit of the physical volume. - if( m/^PE Size \((\S+)\)\s+(\S+)/ ) { + if( m/PE Size \((\S+)\)\s+(\S+)/ ) { $pvhash{pe_size} = $2; $pvhash{pe_size_unit} = $1; next PVINF; } # Get the total numver of physical extents on the physical volume. - if( m/^Total PE\s+(\S+)/ ) { + if( m/Total PE\s+(\S+)/ ) { $pvhash{total_pe} = $1; next PVINF; } # Get the number of free extents on the physical volume. - if( m/^Free PE\s+(\S+)/ ) { + if( m/Free PE\s+(\S+)/ ) { $pvhash{free_pe} = $1; next PVINF; } # Get the number of allocated physical extents on the physical volume. - if( m/^Allocated PE\s+(\S+)/ ) { + if( m/Allocated PE\s+(\S+)/ ) { $pvhash{alloc_pe} = $1; next PVINF; } # Get the UUID of the physical volume. - if( m/^PV UUID\s+(\S+)/ ) { + if( m/PV UUID\s+(\S+)/ ) { $pvhash{uuid} = $1; next PVINF; } } @@ -428,69 +445,74 @@ my $lvname = $_[0]; my %lvhash; if( ! -e "$lvname" ) { die("Logical Disk: $lvname does not exist."); } - if( ! -e "/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } - my @lvinfo = `/sbin/lvdisplay $lvname`; + if( ! -e "/usr/sbin/lvdisplay" ) { die("LVM utilities not installed in /sbin"); } + my @lvinfo = `/usr/sbin/lvdisplay $lvname`; LVINF: foreach(@lvinfo) { # Get the logical volume name. - if( m/^LV Name\s+(\S+)/ ) { + if( m/LV Name\s+(\S+)/ ) { $lvhash{lv_name} = $1; next LVINF; } # Get the volume group name. - if( m/^VG Name\s+(\S+)/ ) { + if( m/VG Name\s+(\S+)/ ) { $lvhash{vg_name} = $1; next LVINF; } + # Get the volume group name. + if( m/LV UUID\s+(\S+)/ ) { + $lvhash{uuid} = $1; + next LVINF; } + # Get the logical volume write status. - if( m/^LV Write Access\s+(.+)/ ) { + if( m/LV Write Access\s+(.+)/ ) { $lvhash{access} = $1; next LVINF; } # Get the logical volume status. - if( m/^LV Status\s+(.+)/ ) { + if( m/LV Status\s+(.+)/ ) { $lvhash{status} = $1; next LVINF; } # Get the logical volume number. - if( m/^LV \#\s+(\S+)/ ) { + if( m/LV \#\s+(\S+)/ ) { $lvhash{lv_number} = $1; next LVINF; } # Get the number of opens for the logical volume. - if( m/^\# open\s+(\S+)/ ) { + if( m/\# open\s+(\S+)/ ) { $lvhash{lv_open} = $1; next LVINF; } # Get the logical volume size and size unit. - if( m/^LV Size\s+(\S+) (\S+)/ ) { + if( m/LV Size\s+(\S+) (\S+)/ ) { $lvhash{size} = $1; $lvhash{size_unit} = $2; next LVINF; } # Get the number of extents assigned to the logical volume. - if( m/^Current LE\s+(\S+)/ ) { + if( m/Current LE\s+(\S+)/ ) { $lvhash{current_le} = $1; next LVINF; } # Get the number of extents allocated to the logical volume. - if( m/^Allocated LE\s+(\S+)/ ) { + if( m/Allocated LE\s+(\S+)/ ) { $lvhash{alloc_le} = $1; next LVINF; } # Get the extent allocation type of the logical volume. - if( m/^Allocation\s+(.+)/ ) { + if( m/Allocation\s+(.+)/ ) { $lvhash{allocation} = $1; next LVINF; } # Get the number of read ahead sectors for the logical volume. - if( m/^Read ahead sectors\s+(\S+)/ ) { + if( m/Read ahead sectors\s+(\S+)/ ) { $lvhash{read_ahead} = $1; next LVINF; } # Get the block device of the logical volume. - if( m/^Block device\s+(\S+)/ ) { + if( m/Block device\s+(\S+)/ ) { $lvhash{block_device} = $1; next LVINF; } } diff -Nurb liblinux-lvm-perl-0.13/MANIFEST liblinux-lvm-perl-0.14/MANIFEST --- liblinux-lvm-perl-0.13/MANIFEST 2003-04-10 18:34:05.000000000 +0530 +++ liblinux-lvm-perl-0.14/MANIFEST 2008-07-02 13:25:20.000000000 +0530 @@ -7,3 +7,4 @@ examples/get_lv_info.pl examples/get_pv_info.pl examples/prt_vg_info.pl +META.yml Module meta-data (added by MakeMaker) diff -Nurb liblinux-lvm-perl-0.13/META.yml liblinux-lvm-perl-0.14/META.yml --- liblinux-lvm-perl-0.13/META.yml 1970-01-01 05:30:00.000000000 +0530 +++ liblinux-lvm-perl-0.14/META.yml 2008-07-02 13:25:20.000000000 +0530 @@ -0,0 +1,10 @@ +# http://module-build.sourceforge.net/META-spec.html +#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# +name: Linux-LVM +version: 0.14 +version_from: LVM.pm +installdirs: site +requires: + +distribution_type: module +generated_by: ExtUtils::MakeMaker version 6.30 diff -Nurb liblinux-lvm-perl-0.13/README liblinux-lvm-perl-0.14/README --- liblinux-lvm-perl-0.13/README 2003-04-04 18:32:52.000000000 +0530 +++ liblinux-lvm-perl-0.14/README 2008-03-02 07:59:00.000000000 +0530 @@ -1,4 +1,4 @@ -Linux/LVM version 0.01 +Linux/LVM version 0.14 ====================== This module was written so that I could create my own disk allocation @@ -22,7 +22,7 @@ COPYRIGHT AND LICENCE -Copyright (C) 2003 Chad Kerner +Copyright (C) 2008 Chad Kerner This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.