Don't add blank options to rsync command line

Rsync doesn't like this so much:
    Unexpected remote arg: rsync://mirror.example.com/archlinux/lastsync
    rsync error: syntax or usage error (code 1) at main.c(1214) [sender=3.0.9]

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2013-03-06 21:38:58 -06:00
parent 7c8b09b95c
commit ace95f6e53

View File

@ -169,7 +169,11 @@ def check_rsync_url(mirror_url, location, timeout):
ipopt = '--ipv4'
lastsync_path = os.path.join(tempdir, 'lastsync')
rsync_cmd = ["rsync", "--quiet", "--contimeout=%d" % timeout,
"--timeout=%d" % timeout, ipopt, url, lastsync_path]
"--timeout=%d" % timeout]
if ipopt:
rsync_cmd.append(ipopt)
rsync_cmd.append(url)
rsync_cmd.append(lastsync_path)
try:
with open(os.devnull, 'w') as devnull:
logger.debug("rsync cmd: %s", ' '.join(rsync_cmd))