From: Ian Jackson Date: Wed, 11 Jul 2018 11:02:26 +0000 (+0100) Subject: cr-publish-flight-logs: Refactor copydir args X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=22de9b7b9f8613c4d6d3a5d66abcff81f4b0a9e4;p=people%2Froyger%2Fosstest.git cr-publish-flight-logs: Refactor copydir args Have it take $cfgbase and $subdir instead. This allows us to lift the config test into it. And it will be even more useful in a moment. No functional change. Signed-off-by: Ian Jackson --- diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs index 1e5a49d..539318d 100755 --- a/cr-publish-flight-logs +++ b/cr-publish-flight-logs @@ -57,7 +57,10 @@ if ($push_harness) { } sub copydir ($$) { - my ($src,$dst) = @_; + my ($cfgbase,$subdir) = @_; + return unless $c{"${cfgbase}Publish"}; + my $src = $c{$cfgbase}.$subdir."/"; + my $dst = $c{"${cfgbase}Publish"}.$subdir; my @cmd= qw(rsync --compress --compress-level=9 --stats --delete -auH); push @cmd, '-e', 'ssh -o batchmode=yes'; #--bwlimit=50 @@ -66,6 +69,5 @@ sub copydir ($$) { $!=0; $?=0; system @cmd; die "rsync $? $!" if $? or $!; } -copydir("$c{Logs}/$flight/", "$c{LogsPublish}/$flight") - if $flight && $c{LogsPublish}; -copydir("$c{Results}/", "$c{ResultsPublish}") if $c{ResultsPublish}; +copydir(qw(Logs), "/$flight") if $flight; +copydir(qw(Results), '');