From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 07/13] target_jobdir: Create the directory Date: Fri, 16 May 2014 19:01:34 +0100 Message-ID: <1400263300-22903-8-git-send-email-ian.jackson@eu.citrix.com> References: <1400263300-22903-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WlMSX-0002At-EY for xen-devel@lists.xenproject.org; Fri, 16 May 2014 18:02:17 +0000 In-Reply-To: <1400263300-22903-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 Callers of target_jobdir can now rely on the directory existing after it returns. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index d72a02c..6dd0247 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1709,9 +1709,15 @@ END sub target_jobdir ($) { my ($ho) = @_; - my $leaf= "build.$flight.$job"; - my $homedir = get_host_property($ho, 'homedir', '/home/osstest'); - return "$homedir/$leaf"; + my $jobdir = $ho->{JobDir}; + if (!$jobdir) { + my $leaf= "build.$flight.$job"; + my $homedir = get_host_property($ho, 'homedir', '/home/osstest'); + $jobdir = "$homedir/$leaf"; + target_cmd($ho, "mkdir -p $jobdir", 60); + $ho->{JobDir} = $jobdir; + } + return $jobdir; } sub target_extract_jobdistpath_subdir ($$$$) { -- 1.7.10.4