running drush dl drupal doesn't download anything. I can run drush status and it seems to work. This is Solaris 10 x86

Comments

redndahead’s picture

Status: Active » Needs review
StatusFileSize
new935 bytes

Tracked it down to the fact that solaris 10 tar command doesn't work with the -C option. Would a patch like this be acceptable?

moshe weitzman’s picture

Status: Needs review » Needs work

I would prefer a patch which changes drush to not use the -C option. It is a problem on windows too. See #483110: Update fails silently on Windows (GNU Tar on Windows) . We should untar in place and then copy the files in php.

redndahead’s picture

Is there a way to get the current path that drush is installed at?

greg.1.anderson’s picture

How about using $path, as it is currently passed to tar -C, to specify the destination? Just a suggestion, since it seems to work today on platforms that support gnu tar.

redndahead’s picture

That's not what I'm looking for. I'm looking for a return of something like /home/username/drush I have a work around now until I get an answer to that. I'll be posting a patch soon.

redndahead’s picture

StatusFileSize
new1.1 KB

greg.1.anderson sorry my brain didn't process what you said. But $path was exactly what I needed. Here is the patch.

redndahead’s picture

Status: Needs work » Needs review
redndahead’s picture

Would their be a need to set it back to the old working directory after we have done our part?

greg.1.anderson’s picture

drush saves the cwd during the bootstrap process, so probably not.

Note that this patch isn't quite what Moshe suggested; he wanted to untar in place and then copy with php. You could also copy with rsync; check out how sync.sql.inc uses drush_core_call_rsync to do this.

For my part, though, the chdir looks okay. Moshe?

redndahead’s picture

I understand it wasn't what he was asking for but I think this is a whole lot easier and accomplishes the same task. To use the copy method we would have to set up a tmp directory to copy to. We couldn't use the current directory that we were in because if I'm in drupal root and I want a module called "profiles" then we would have an issue. Using the destination directory, I think, is going to be our best bet.

moshe weitzman’s picture

hmm. chdir is really problematic in drush. consider what happens if something fails and the rest of drush exectutes in the wrong directory. remember that all drush commands can have rollbacks that run afterwards. those rollbacks would be quite surpised if cwd has changed.

redndahead’s picture

As we check for errors we can role back when needed. Really if I add a change back at the end then it shouldn't be a problem. Patch will come soon.

redndahead’s picture

Title: drush dl drupal reports success but nothing is downloaded solaris 10 » tar command doesn't work on windows or solaris
StatusFileSize
new2.01 KB

Here is the patch. Renamed title to be more descriptive.

moshe weitzman’s picture

looks real nice. needs testing. thanks redndahead

moshe weitzman’s picture

Anyone available to test this?

greg.1.anderson’s picture

Assigned: Unassigned » greg.1.anderson

I'll have time to test this shortly--assigning to myself. Anyone else who feels like testing it first, please jump in and do so.

greg.1.anderson’s picture

Status: Needs review » Reviewed & tested by the community

Works for me. I did not test on Windows or Solaris. What I did do was install a wrapper for tar and confirm that drush dl and drush updatecode work correctly without using tar -C.

For example:

Downloading securepages_prevent_hijack-6.x-1.5.tar.gz was successful.   [notice]
Md5 checksum of securepages_prevent_hijack-6.x-1.5.tar.gz verified.     [notice]
Executing: gzip -d securepages_prevent_hijack-6.x-1.5.tar.gz            [notice]
Executing: tar -xf securepages_prevent_hijack-6.x-1.5.tar               [notice]
  tar -xf securepages_prevent_hijack-6.x-1.5.tar
Calling unlink(securepages_prevent_hijack-6.x-1.5.tar)
Project securepages_prevent_hijack was updated successfully. Installed version is now 6.x-1.5.

I tested the error cases by modifying the code so the md5 chksum would fail, and it seemed to behave as expected--although in my specific cases, it didn't seem to matter that the directory was or was not restored, so I'd have to say that the failure states were mostly done by inspection.

My opinion is this is okay to commit.

moshe weitzman’s picture

Status: Reviewed & tested by the community » Fixed

committed. many thanks. this will help many people.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.