seattlerb/rake-remote_task

failing rsync with non-default rsync_flags

eval opened this issue · 4 comments

eval commented

See this gist:
https://gist.github.com/664852

Executing 'rake should_fail' fails with in the ouput (output#L8):
execution failed: rsync --exclude ".git" -azP --delete ./ strato2.thinkcreate.nl:/tmp

This command can be successfully executed though.
Any idea what might be wrong?

eval commented

to further clarify:
at this point:
https://github.com/seattlerb/rake-remote_task/blob/master/lib/rake/remote_task.rb#L154
the code effectively failing is:
system(*['rsync', '--exclude ".git"', '-azP', '--delete', './', 'strato2.thinkcreate.nl:/tmp'])

This would work however:
system('rsync --exclude ".git" -azP --delete ./ strato2.thinkcreate.nl:/tmp')

The code and tests seem to imply however that the former is preferred, is that correct?

btw, this works:
set :rsync_flags, ['--exclude=".git"', '-azP', '--delete']

I'm just guessing, but I think your args are wrong. It should probably be:

set :rsync_flags, ['--exclude', '.git', '-azP', '--delete']

Can you test that out? I just tried it with:

 % rm /tmp/x/*.pdf
 % ruby -e 'system(*%w(rsync -avP) + ["--exclude", "*.pdf"] + ARGV)' ./ /tmp/x

and it seems correct.

After further testing I'm sure this is the problem. Reopen if I misunderstood.

eval commented

yup, you're right - thanks for verifying!