From dc2deeb8fe54045ebfd0c0a08467e00738aaa0ae Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 28 Mar 2012 08:00:59 +0200 Subject: [PATCH] use dir_glob_* from PVE::Tools --- Makefile | 2 +- PVE/Storage.pm | 32 +------------------------------- changelog.Debian | 6 ++++++ 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 806a072..beed356 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.0 VERSION=2.0 PACKAGE=libpve-storage-perl -PKGREL=15 +PKGREL=16 DESTDIR= PREFIX=/usr diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 45f0213..c72a62d 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -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 diff --git a/changelog.Debian b/changelog.Debian index b48601c..a011140 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,9 @@ +libpve-storage-perl (2.0-16) unstable; urgency=low + + * use dir_glob_* from PVE::Tools + + -- Proxmox Support Team 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)