From 7e35655bea3f484139764c9e69c048fe8ee43392 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 9 Jul 2015 15:30:35 +0100 Subject: [PATCH] cr-publish-flight-logs: allow publishing only the Results 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 Acked-by: Ian Jackson --- 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.39.5