X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=tools%2Fvirt-list-filesystems;h=921704b26116d4c9e4942a03c6bfaaac11903be0;hp=50024aa273860bcd008f6ded1cdda05efaadf4e5;hb=8f6d8b05152fda68e0c01848c0e5239e0093548a;hpb=299d5b9dd260d47ac5121126ecd0e3f7bc4830b5 diff --git a/tools/virt-list-filesystems b/tools/virt-list-filesystems index 50024aa..921704b 100755 --- a/tools/virt-list-filesystems +++ b/tools/virt-list-filesystems @@ -24,7 +24,6 @@ use Sys::Guestfs::Lib qw(open_guest get_partitions); use Pod::Usage; use Getopt::Long; use Locale::TextDomain 'libguestfs'; -use File::Temp qw/tempdir/; =encoding utf8 @@ -144,22 +143,22 @@ foreach $dev (@partitions) { my $mountable = $@ ? 0 : 1; $g->umount_all (); if ($mountable) { - push @fses, $dev; + push @fses, $dev; } else { - push @not_mountable, $dev; + push @not_mountable, $dev; } } foreach $dev (@fses) { print canonicalize($dev); if ($long) { - my $fstype; - eval { $fstype = $g->vfs_type ($dev); }; - if ($fstype) { - print " $fstype"; - } else { - print " unknown"; - } + my $fstype; + eval { $fstype = $g->vfs_type ($dev); }; + if ($fstype) { + print " $fstype"; + } else { + print " unknown"; + } } print "\n"; } @@ -167,13 +166,13 @@ foreach $dev (@fses) { # If asked, look in the not_mountable list for potential swap devices. if ($all) { foreach $dev (@not_mountable) { - my $file; - eval { $file = $g->file ($dev); }; - if ($file && $file =~ /\bswap\b/) { - print canonicalize($dev); - print " swap" if $long; - print "\n" - } + my $file; + eval { $file = $g->file ($dev); }; + if ($file && $file =~ /\bswap\b/) { + print canonicalize($dev); + print " swap" if $long; + print "\n" + } } } @@ -184,7 +183,7 @@ sub canonicalize local $_ = shift; if (m{^/dev/[hv]d([a-z]\d)$}) { - return "/dev/sd$1"; + return "/dev/sd$1"; } $_; } @@ -195,6 +194,7 @@ L, L, L, L, +L, L, L, L, @@ -202,7 +202,7 @@ L. =head1 AUTHOR -Richard W.M. Jones L +Richard W.M. Jones L =head1 COPYRIGHT