 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [OSSTEST PATCH 4/8] cr-publish-flight-logs: Refactor rsync -e option construction
 Previously this was hardcoded.  Now we make a variable @ssh, and use
rsync's quoting scheme to transform it into a value suitable for -e.
No overall functional change, although now the rsync command contains
additional quotes in the -e option.
Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 cr-publish-flight-logs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cr-publish-flight-logs b/cr-publish-flight-logs
index 539318d..9e13652 100755
--- a/cr-publish-flight-logs
+++ b/cr-publish-flight-logs
@@ -61,8 +61,9 @@ sub copydir ($$) {
     return unless $c{"${cfgbase}Publish"};
     my $src = $c{$cfgbase}.$subdir."/";
     my $dst = $c{"${cfgbase}Publish"}.$subdir;
+    my @ssh = qw(ssh -o batchmode=yes);
     my @cmd= qw(rsync --compress --compress-level=9 --stats --delete -auH);
-    push @cmd, '-e', 'ssh -o batchmode=yes';
+    push @cmd, '-e', join(' ', map { s/\'/''/g; "'$_'"; } @ssh);
     #--bwlimit=50
     push @cmd, $src, $dst;
     print "+ @cmd\n";
-- 
2.1.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |