]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
cr-publish-flight-logs: allow publishing only the Results
authorIan Campbell <ian.campbell@citrix.com>
Thu, 9 Jul 2015 14:30:35 +0000 (15:30 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 10 Jul 2015 13:26:07 +0000 (14:26 +0100)
Removing the requirement that a flight be provided allows this to be
used to publish the results directory even in contexts which have no
flight.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
cr-publish-flight-logs

index 94c74c8a8497473a9b97c81da34b86b62dfb044c..8a19d883781518dd07fa86602580bac750f421e3 100755 (executable)
@@ -31,10 +31,10 @@ if (@ARGV && $ARGV[0] eq '--push-harness') {
     $push_harness = 1;
 }
 
-die "usage: ./cr-publish-flight-logs <flight>" unless @ARGV==1;
+my $flight= shift @ARGV // '';
+die unless $flight =~ m/^\d*$/;
 
-my $flight= shift @ARGV;
-die unless $flight =~ m/^\d+$/;
+die "usage: ./cr-publish-flight-logs [flight]" unless @ARGV==0;
 
 open LOCK, "> $c{GlobalLockDir}/publish-lock" or die $!;
 flock LOCK, LOCK_EX or die $!;
@@ -59,5 +59,6 @@ sub copydir ($$) {
     $!=0; $?=0; system @cmd; die "rsync $? $!" if $? or $!;
 }
 
-copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight") if $c{LogsPublish};
+copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight")
+    if $flight && $c{LogsPublish};
 copydir("$c{Results}/", "$c{ResultsPublish}") if $c{ResultsPublish};