running drush dl drupal doesn't download anything. I can run drush status and it seems to work. This is Solaris 10 x86
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | tar-636738-3.patch | 2.01 KB | redndahead |
| #6 | tar-636738-2.patch | 1.1 KB | redndahead |
| #1 | tar_solaris-636738-1.patch | 935 bytes | redndahead |
Comments
Comment #1
redndahead commentedTracked it down to the fact that solaris 10 tar command doesn't work with the -C option. Would a patch like this be acceptable?
Comment #2
moshe weitzman commentedI 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.
Comment #3
redndahead commentedIs there a way to get the current path that drush is installed at?
Comment #4
greg.1.anderson commentedHow 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.
Comment #5
redndahead commentedThat'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.
Comment #6
redndahead commentedgreg.1.anderson sorry my brain didn't process what you said. But $path was exactly what I needed. Here is the patch.
Comment #7
redndahead commentedComment #8
redndahead commentedWould their be a need to set it back to the old working directory after we have done our part?
Comment #9
greg.1.anderson commenteddrush 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?
Comment #10
redndahead commentedI 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.
Comment #11
moshe weitzman commentedhmm. 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.
Comment #12
redndahead commentedAs 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.
Comment #13
redndahead commentedHere is the patch. Renamed title to be more descriptive.
Comment #14
moshe weitzman commentedlooks real nice. needs testing. thanks redndahead
Comment #15
moshe weitzman commentedAnyone available to test this?
Comment #16
greg.1.anderson commentedI'll have time to test this shortly--assigning to myself. Anyone else who feels like testing it first, please jump in and do so.
Comment #17
greg.1.anderson commentedWorks for me. I did not test on Windows or Solaris. What I did do was install a wrapper for tar and confirm that
drush dlanddrush updatecodework correctly without using tar -C.For example:
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.
Comment #18
moshe weitzman commentedcommitted. many thanks. this will help many people.