]> xenbits.xensource.com Git - osstest.git/commitdiff
sg-report-flight: mkdir the per-job directories
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 7 Apr 2014 15:29:34 +0000 (16:29 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Sat, 19 Apr 2014 19:06:51 +0000 (20:06 +0100)
This makes sure the per-job pages always get created.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
sg-report-flight

index e6f33391e3b477c216e6a489561b1bece01c1ec4..1a7c3169c2b4f1df6c2e55948f354008ed3c8187 100755 (executable)
@@ -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};