From: Ian Jackson Subject: [OSSTEST PATCH 19/32] cr-ensure-disk-space: Do listing of flights on target. Date: Tue, 24 Mar 2015 19:02:42 +0000 Message-ID: <1427223775-8592-20-git-send-email-ian.jackson@eu.citrix.com> References: <1427223775-8592-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YaU6a-00005n-S1 for xen-devel@lists.xenproject.org; Tue, 24 Mar 2015 19:03:12 +0000 In-Reply-To: <1427223775-8592-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Jackson --- 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 (

) { + 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