]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
cr-ensure-disk-space: Do listing of flights on target.
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 9 Mar 2015 16:15:07 +0000 (12:15 -0400)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Mar 2015 18:56:02 +0000 (18:56 +0000)
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
cr-ensure-disk-space

index 6f129bd62a95d2e4938c9f396d9907fe535210c1..af8efe6f33e177880e5ed8290781db48d5f3f141 100755 (executable)
@@ -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;
     }