From dd2ba39d323438b286c52460ab896757b5005e5c Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 13 Dec 2015 09:41:19 +0000 Subject: [PATCH] Use rsync instead of scp for file transfers to save time on cache download from VM --- libexec/copy-from-target | 4 ++-- libexec/copy-to-target | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/copy-from-target b/libexec/copy-from-target index cf7c4f7..dd4949b 100755 --- a/libexec/copy-from-target +++ b/libexec/copy-from-target @@ -3,7 +3,7 @@ . gconfig TUSER=${DISTRO:-ubuntu} -QUIET_FLAG= +QUIET_FLAG="-vP" usage() { echo "Usage: ${0##*/} [OPTION]... " @@ -47,7 +47,7 @@ if [ $# = 0 ] ; then fi if [ -z "$USE_LXC" ]; then - scp $QUIET_FLAG -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -P $VM_SSH_PORT -r $TUSER@localhost:$1 $2 + rsync --checksum -a $QUIET_FLAG -e "ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -p $VM_SSH_PORT" "$TUSER@localhost:$1" "$2" else config-lxc sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -i -u $TUSER tar -C `dirname "$1"` -cf - `basename "$1"` | tar -C "$2" -xf - diff --git a/libexec/copy-to-target b/libexec/copy-to-target index 3b1784b..f92c93b 100755 --- a/libexec/copy-to-target +++ b/libexec/copy-to-target @@ -3,7 +3,7 @@ . gconfig TUSER=${DISTRO:-ubuntu} -QUIET_FLAG= +QUIET_FLAG="-vP" usage() { echo "Usage: ${0##*/} [OPTION]... " @@ -47,7 +47,7 @@ if [ $# = 0 ] ; then fi if [ -z "$USE_LXC" ]; then - scp $QUIET_FLAG -r -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -P $VM_SSH_PORT $1 $TUSER@localhost:$2 + rsync --checksum -a $QUIET_FLAG -e "ssh -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_rsa -p $VM_SSH_PORT" "$1" "$TUSER@localhost:$2" else config-lxc tar -C `dirname "$1"` -cf - `basename "$1"` | sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -i -u $TUSER tar -C "$2" -xf -