gitian-builder/libexec/copy-from-target
Wladimir J. van der Laan cdb3bb4d43 Increase ssh connection timeout to 30 seconds
The previous 5-second timeout causes random errors during compilation
here, increasing it to 30 seconds solves this problem.
2013-05-10 19:56:29 +02:00

55 lines
972 B
Bash
Executable File

#!/bin/sh
. gconfig
TUSER=ubuntu
QUIET_FLAG=
usage() {
echo "Usage: ${0##*/} [OPTION]... <command>"
echo "Run command on build target."
echo
cat << EOF
--help display this help and exit
--user=U run as U instead of ubuntu
EOF
}
if [ $# != 0 ] ; then
while true ; do
case "$1" in
--help|-h)
usage
exit 0
;;
--user|-u)
TUSER="$2"
shift 2
;;
--quiet|-q)
QUIET_FLAG="-q"
shift 1
;;
--*)
echo "unrecognized option $1"
exit 1
;;
*)
break
;;
esac
done
fi
if [ $# = 0 ] ; then
usage
exit 1
fi
if [ -z "$USE_LXC" ]; then
scp $QUIET_FLAG -oConnectTimeout=30 -oNoHostAuthenticationForLocalhost=yes -i ${GITIAN_BASE:-.}/var/id_dsa -P $VM_SSH_PORT -r $TUSER@localhost:$1 $2
else
config-lxc
sudo lxc-start -n gitian -f var/lxc.config -- sudo -i -u $TUSER tar -cf - "$1" | tar -C "$2" -xkf -
fi