[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 19/32] cr-ensure-disk-space: Do listing of flights on target.



Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 cr-ensure-disk-space |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/cr-ensure-disk-space b/cr-ensure-disk-space
index 6f129bd..af8efe6 100755
--- a/cr-ensure-disk-space
+++ b/cr-ensure-disk-space
@@ -71,11 +71,13 @@ for (;;) {
     last if $space >= $c{LogsMinSpaceMby};
 
     if (!@flights) {
-        opendir D, "." or die $!;
-        $!=0;
-        @flights = sort { $b <=> $a } grep { m/^\d+$/ } readdir D;
-        die if $!;
-        closedir D or die $!;
+       open P, "-|", ontarget "ls -1 $pubdir" or die $!;
+       while (<P>) {
+           next unless m/^(\d+)\n$/;
+           push @flights, $1;
+       }
+       $!=$?=0; close P or die "ls: $? $!";
+       @flights = sort { $b <=> $a } @flights;
         printf "(%d flights) ", scalar @flights;
         die unless @flights;
     }
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.