If there is an old version, i.e. sites/all/modules/devel-6.x-1.x-dev.tar.gz, when I use pm update, drush will use wget to download the new version, but the filename will be devel-6.x-1.x-dev.tar.gz.1

Then, due to filename is different, the MD5 check doesn't pass. Suggest to overwrite the original file or show an error to users.

Comments

kpolymorphic’s picture

Assigned: Unassigned » kpolymorphic

I am trying to replicate this in preparation for exploring a fix

owen barton’s picture

Noticed this myself - I think overwriting (rather than moving out of the way) is probably fine behavior, since our filenames are pretty unique.

I was actually thinking that for proper behaviour we should download the tar.gz files to /tmp (or an optional user provided temp directory), and then use the -C parameter to tar to extract them to the correct directory base, rather than using the parent directory for the tarball scratch space.

kpolymorphic’s picture

The short term fix must be to backup the offending file since it is external to drush and we would have no idea whether it contains valuable data.

This is actually kind of an edge case because only development releases of projects have the same file name across multiple versions. Under production use, this kind of naming collision would not happen during an update; by definition the update version would have a different file name.

For the long term, I was also thinking along the same lines too. We would have to be careful with a shared location due to concurrent users... I would expect that a unique drush session identifier would need to be generated and used as a directory name under the download temporary area to avoid further headaches with respect to naming collisions.

kpolymorphic’s picture

Assigned: kpolymorphic » Unassigned
kpolymorphic’s picture

Assigned: Unassigned » kpolymorphic
kpolymorphic’s picture

Status: Needs review » Active

Well, I replicated this issue in the DRUPAL-6--1-2 release tag and also found that it has already been fixed in the DRUPAL-6--1 branch head. It simply overwrites the offending file at this time.

kpolymorphic’s picture

Status: Active » Needs review
moshe weitzman’s picture

Status: Active » Needs review

we have unpublished all releases for the moment. use head. for drush_extras, use the tip for the version of drupal you need. drush_extras is soon being folded back into drush, fyi.

moshe weitzman’s picture

Status: Needs review » Closed (won't fix)