From: Ian Campbell Subject: [PATCH OSSTEST v8 1/2] cr-publish-flight-logs: allow publishing only the Results Date: Thu, 9 Jul 2015 15:30:35 +0100 Message-ID: <1436452236-3334-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 --- v7: New patch v8: No need for a list of files, just allow to omit publishing flight. Therefore flight becomes optional. Renamed from : cr-publish-flight-logs: support publishing files from $HOME/public_html --- cr-publish-flight-logs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs index 94c74c8..8a19d88 100755 --- a/cr-publish-flight-logs +++ b/cr-publish-flight-logs @@ -31,10 +31,10 @@ if (@ARGV && $ARGV[0] eq '--push-harness') { $push_harness = 1; } -die "usage: ./cr-publish-flight-logs " 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}; -- 2.1.4