[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 3/6] sg-report-flight: mkdir the per-job directories



This makes sure the per-job pages always get created.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.