Because the wget handler un-tars the package overtop the old one, when a file should be removed it won't be.
This has the potential to break modules pretty badly.
Because the wget handler un-tars the package overtop the old one, when a file should be removed it won't be.
This has the potential to break modules pretty badly.
Comments
Comment #1
owen barton commentedIf you are not using SVN then it shouldn't do this - the original directory should be moved to a backups directory first. Possibly this is broken, but I tested it recently so I don't think so.
However, if you are using SVN with wget, then I think this is indeed the current behavior. A simple workaround is to the CVS package handler, rather than wget. The easy "fix" for this is simply to add some documentation or a notice that pops up with this combination.
The full (and quite a bit more complex) fix is to untar into a temporary directory, and then diff the 2 directories and apply the patch to the checked out version.
Comment #2
grendzy commentedThanks for the followup — I do indeed prefer the CVS handler; I bumped into this while doing some maintenance on a site primarily maintained by another developer, and I didn't want to introduce CVS to the mix.
Diff / patch is a good idea; I had also considered maybe untarring to an outside place, and then using rsync.
Comment #3
MMachnik commentedI've run into this as well. It would be great if drush could detect which files are no longer part of the module and remove them.
In the meantime, these steps work:
* download new version of module and extract it to a temporary directory i.e. "tmp/module".
* rsync new version to old one, here the example is 'date':
$ rsync -avC --delete date/ ../date
This will remove old files, add new ones and update ones that have been changed -- and leave the .svn directories alone.
* Then, you just need to add your new files (denoted in 'svn status' by a '!') and remove old ones (denoted in svn status by a '?'):
$ svn st . | egrep ^\\! | awk '{print $2}' | xargs -i svn rm {}
$ svn st . | egrep ^\\? | awk '{print $2}' | xargs -i svn add {}
Thanks to cpliakas for some of these ideas!
Comment #4
juhaniemi commentedsubscribe
Comment #5
jonhattanrecently fixed in #781040: Drush is not removing old files when updating modules with svnsync