use dir_glob_* from PVE::Tools
This commit is contained in:
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ RELEASE=2.0
|
||||
|
||||
VERSION=2.0
|
||||
PACKAGE=libpve-storage-perl
|
||||
PKGREL=15
|
||||
PKGREL=16
|
||||
|
||||
DESTDIR=
|
||||
PREFIX=/usr
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user