]> git.proxmox.com Git - pve-storage.git/commitdiff
use dir_glob_* from PVE::Tools
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 28 Mar 2012 06:00:59 +0000 (08:00 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 28 Mar 2012 06:00:59 +0000 (08:00 +0200)
Makefile
PVE/Storage.pm
changelog.Debian

index 806a07296376bca6019ff5b487641b7b259c9c41..beed3569e5d6f58206aba413b45d1178cd652573 100644 (file)
--- 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
index 45f0213622c224904157fdfb3f8c9e8b43c71524..c72a62d0f682abd7a21cab12a95b68b105d39e1d 100755 (executable)
@@ -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
index b48601c94b90f93004f5142ce6cc6edf4040e8f7..a011140f6bb6727e71ce537a58bfa891f09c4226 100644 (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)