From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 3/6] sg-report-flight: mkdir the per-job directories Date: Mon, 7 Apr 2014 17:27:54 +0100 Message-ID: <1396888077-9619-4-git-send-email-ian.jackson@eu.citrix.com> References: <1396888077-9619-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 1WXCP3-0007qN-EX for xen-devel@lists.xenproject.org; Mon, 07 Apr 2014 16:28:09 +0000 In-Reply-To: <1396888077-9619-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 This makes sure the per-job pages always get created. Signed-off-by: Ian Jackson --- sg-report-flight | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sg-report-flight b/sg-report-flight index e6f3339..1a7c316 100755 --- a/sg-report-flight +++ b/sg-report-flight @@ -27,6 +27,7 @@ use URI::Escape; use POSIX; use IPC::Open2; use Data::Dumper; +use File::Path; use Osstest; use Osstest::Executive; @@ -757,11 +758,12 @@ sub htmloutjob ($$) { my ($fi,$job) = @_; return unless defined $htmldir; - my $htmlfile= "$htmldir/$job/$htmlleaf"; - if (!open H, "> $htmlfile.new") { - return if $!==&ENOENT; - die "$htmlfile.new $!"; - } + my $jobhtmldir = "$htmldir/$job"; + mkpath $jobhtmldir; + + my $htmlfile= "$jobhtmldir/$htmlleaf"; + open H, "> $htmlfile.new" or die "$htmlfile.new $!"; + my $title= "Info on flight $fi->{Flight} job $job"; my $branch= $fi->{FlightInfo}{branch}; -- 1.7.10.4