use dir_glob_* from PVE::Tools

This commit is contained in:
Dietmar Maurer
2012-03-28 08:00:59 +02:00
parent da156fb3ef
commit dc2deeb8fe
3 changed files with 8 additions and 32 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=libpve-storage-perl
PKGREL=15
PKGREL=16
DESTDIR=
PREFIX=/usr

View File

@ -16,7 +16,7 @@ use Socket;
use Digest::SHA;
use Net::Ping;
use PVE::Tools qw(run_command file_read_firstline trim);
use PVE::Tools qw(run_command file_read_firstline trim dir_glob_regex dir_glob_foreach);
use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
use PVE::Exception qw(raise_param_exc);
use PVE::JSONSchema;
@ -79,36 +79,6 @@ sub load_stable_scsi_paths {
return $stable_paths;
}
sub dir_glob_regex {
my ($dir, $regex) = @_;
my $dh = IO::Dir->new ($dir);
return wantarray ? () : undef if !$dh;
while (defined(my $tmp = $dh->read)) {
if (my @res = $tmp =~ m/^($regex)$/) {
$dh->close;
return wantarray ? @res : $tmp;
}
}
$dh->close;
return wantarray ? () : undef;
}
sub dir_glob_foreach {
my ($dir, $regex, $func) = @_;
my $dh = IO::Dir->new ($dir);
if (defined $dh) {
while (defined(my $tmp = $dh->read)) {
if (my @res = $tmp =~ m/^($regex)$/) {
&$func (@res);
}
}
}
}
sub read_proc_mounts {
local $/; # enable slurp mode

View File

@ -1,3 +1,9 @@
libpve-storage-perl (2.0-16) unstable; urgency=low
* use dir_glob_* from PVE::Tools
-- Proxmox Support Team <support@proxmox.com> Wed, 28 Mar 2012 08:00:31 +0200
libpve-storage-perl (2.0-15) unstable; urgency=low
* allow to set option 'maxfiles' (we will use this for vzdump)