Closed (fixed)
Project:
Drush
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
3 Nov 2010 at 14:38 UTC
Updated:
26 Mar 2011 at 09:05 UTC
When i try to download i get the following errror with the latest drush-All-Versions-HEAD from 2010-Nov-03:
[yingho@parsley htdocs]$ drush dl tao
rsync: --remove-source-files: unknown option
rsync error: syntax or usage error (code 1) at main.c(1231) [client=2.6.8]
Project tao (6.x-3.2) downloaded to [success]
/home/drupalcms/dpsportsfisk/htdocs/sites/all/themes/tao.
Project tao contains 0 themes: .
It seems to use settings from a newer rsync client (Version 3). Is there a settings where you can disable the rsync settings above or use an alternative settings?
Comments
Comment #1
moshe weitzman commentedsounds like we just introduced a bug with new rsync option. greg?
Comment #2
greg.1.anderson commentedThis looks like a duplicate of #955092: drush support for rsync version lower than 2.6.9, but I don't see how
dlrelates to that issue; as far as I know, only sql-sync uses --remove-source-files. I'll have to investigate.Comment #3
greg.1.anderson commentedThis is what I get:
If #0 was confused and was actually using sql-sync, then everything makes sense, and this is a duplicate. I don't see how dl can be throwing this error.
Comment #4
greg.1.anderson commentedMy test above is invalid; clearly I need to test on a system running rsync protocol 29. My guess is that jonhattan switched the dl code to use rsync rather than rename to fix the cross-volume bug. If that's the case, then this can be fixed by committing #955092: drush support for rsync version lower than 2.6.9 and adding
$options['protocol'] = 29;in drushrc.php.Comment #5
jonhattandrush dl calls drush_move_dir() that try rename() and if it fail, silently calls rsync.
Comment #6
greg.1.anderson commented@yingtho: could you test to see if the advice in #4 clears up the problem for you? I only have one system using rsync protocol 29, and it only has one volume.
Comment #7
luchochs commentedAn alternative could be use
mvinstead ofrsyncindrush_move_dir(), I guess.Comment #8
greg.1.anderson commentedDoes mv have the same cross-volume problem as rename on old versions of *nix? It works on my recent Ubuntu distribution.
Comment #9
luchochs commentedHere (debian v4 / PHP v5.2.0-8+etch16 and linuxmint v7 / PHP v5.2.6-3ubuntu4.5) the rename alternative of drush_move_dir() never works.
In addition, on debian, the rsync alternative does not take place since
drush_op ('mkdir', $dest)(see below) returns FALSE due to the fact thatrename()creates a regular file in $dest (probably PHP's version is involved in this unwanted behavior).Applying the patch of above I do not have the problem (no more
rename()) and the alternative rsync is not necessary (which does not mean it should be removed).Comment #10
greg.1.anderson commentedAre you proposing #9 as a patch to be tested?
If I understand correctly, then on Linux, the 'mv' should always work, and you will go no farther in the code. In Windows, the 'mv' will always fail, but the 'rename' will almost always work (since on Windows, you'll probably be moving from somewhere on C: to somewhere on C: most of the time). If the 'rename' does not work on Windows, then the 'rsync' will also fail (unless you are running under cygwin, in which case the 'mv' would have worked).
Is that about right?
Comment #11
luchochs commentedWindows... I have a tendency to forget that it exists.
More than a proposal to test, my previous comment is what I have to do after a
git pull, i.e., whenever I need to use the HEAD version on my debian distro.In other words, is the description of an unwanted behavior to consider when proposing a solution to this issue, I think.
Comment #12
greg.1.anderson commentedI don't understand #11. Do you mean that you apply the changes in #9 to drush-HEAD every time you update? If that's correct, then perhaps you should attach a patch and set the status to 'needs review'.
If I read #11 another way, though, you are saying that #9 is not a complete fix. Is that just because there is one known system (i.e. Windows) that can fails for all three attempts to move the directory?
Comment #13
luchochs commented#9 is a personal fix for the behavior than I described in the same comment. I will create a new issue for this tomorrow. Sorry if my English was/is not appropriate.
Comment #14
moshe weitzman commentedI'm not clear on whats oustanding. Is it a dupe of the rsync issue?
Comment #15
greg.1.anderson commented#9 is a suggestion for improving a different fix; it could go in a new issue later. Per #6, we're waiting for the OP to confirm this is a dupe; I presume it is. Setting status to 'needs more info'.
Comment #16
luchochs commentedFor reference, #9 is related to this another issue: #968948: Drush returns an error on dl command on subdomain named subsites.domain.com.
Comment #17
jonhattanat present drush_move_dir() try rename and if it fails it does an invincible copy & delete.