diff -Nru drush-5.9/.travis.yml drush-5.10.0/.travis.yml --- drush-5.9/.travis.yml 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/.travis.yml 2013-09-26 16:05:05.000000000 +0000 @@ -2,8 +2,8 @@ # whitelist branches: only: - - 8.x-6.x - - 7.x-5.x + - 6.x + - 5.x language: php php: - 5.3 @@ -27,6 +27,8 @@ - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=pm - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--group=quick-drupal - UNISH_DB_URL=pgsql://postgres:@localhost PHPUNIT_ARGS=--exclude-group=base,make,commands,pm,quick-drupal +notifications: + irc: "irc.freenode.org#drush" before_script: - echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`; export UNISH_DRUSH="${PWD}/drush" && cd tests script: phpunit $PHPUNIT_ARGS diff -Nru drush-5.9/CONTRIBUTING.md drush-5.10.0/CONTRIBUTING.md --- drush-5.9/CONTRIBUTING.md 1970-01-01 00:00:00.000000000 +0000 +++ drush-5.10.0/CONTRIBUTING.md 2013-09-26 16:05:05.000000000 +0000 @@ -0,0 +1,23 @@ +Drush is built by people like you! Please [join us](https://github.com/drush-ops/drush). + +## Git and Pull requests +* Contributions are submitted, reviewed, and accepted using Github pull requests. [Read this article](https://help.github.com/articles/using-pull-requests) for some details. We use the _Fork and Pull_ model, as described there. +* Optionally, to help keep track of [your assigned issues](https://github.com/dashboard/issues/assigned), simply ask to be added to the contributor team. A maintainer can now assign any issue to you at your request. +* The latest changes are in the `master` branch. +* Make a new branch for every feature you're working on. +* Try to make clean commits that are easy readable (including descriptive commit messages!) +* Test before you push. Get familiar with Unish, our test suite. See the test-specific [README.md](tests/README.md) +* Make small pull requests that are easy to review but make sure they do add value by themselves. +* We maintain branches named 6.x, 5.x, etc. These are release branches. From these branches, we make new tags for patch and minor versions. + +## Coding style +* Do write comments. You don't have to comment every line, but if you come up with something thats a bit complex/weird, just leave a comment. Bear in mind that you will probably leave the project at some point and that other people will read your code. Undocumented huge amounts of code are nearly worthless! +* We use [Drupal's coding standards](https://drupal.org/coding-standards). +* Don't overengineer. Don't try to solve any possible problem in one step, but try to solve problems as easy as possible and improve the solution over time! +* Do generalize sooner or later! (if an old solution, quickly hacked together, poses more problems than it solves today, refactor it!) +* Keep it compatible. Do not introduce changes to the public API, or configurations too lightly. Don't make incompatible changes without good reasons! + +## Documentation +* The docs are in the [docs](docs) and [examples](examples) folders in the git repository, so people can easily find the suitable docs for the current git revision. You can read these from within Drush, with the `drush topic` command. +* Documentation should be kept up-to-date. This means, whenever you add a new API method, add a new hook or change the database model, pack the relevant changes to the docs in the same pull request. +* You can build the docs e.g. produce html, using `drush help --html`. This page also resides at http://www.drush.org. You might enjoy prettier and more comprehensive version at [Drush Commands](http://www.drushcommands.com) diff -Nru drush-5.9/LICENSE.txt drush-5.10.0/LICENSE.txt --- drush-5.9/LICENSE.txt 2011-09-17 21:50:19.000000000 +0000 +++ drush-5.10.0/LICENSE.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff -Nru drush-5.9/README.md drush-5.10.0/README.md --- drush-5.9/README.md 1970-01-01 00:00:00.000000000 +0000 +++ drush-5.10.0/README.md 2013-09-26 16:05:05.000000000 +0000 @@ -0,0 +1,414 @@ +DESCRIPTION +----------- + +Drush is a command line shell and Unix scripting interface for Drupal. If you are unfamiliar with shell scripting, reviewing the documentation for your shell (e.g. man bash) or reading an online tutorial (e.g. search for "bash tutorial") will help you get the most out of Drush. + +Drush core ships with lots of useful commands for interacting with code like modules/themes/profiles. Similarly, it runs update.php, executes sql queries and DB migrations, and misc utilities like run cron or clear cache. + +DRUSH VERSIONS +-------------- + +Each version of Drush supports multiple Drupal versions. Drush 6 is recommended version. + +Drush Version | Branch | PHP | Compatible Drupal versions | Code Status +------------- | ------ | --- | -------------------------- | ----------- +Drush 7 | [master](https://travis-ci.org/drush-ops/drush) | 5.3.3+ | D6, D7, D8 | +Drush 6 | [6.x](https://travis-ci.org/drush-ops/drush) | 5.3.3+ | D6, D7 | +Drush 5 | [5.x](https://travis-ci.org/drush-ops/drush) | 5.2.0+ | D6, D7 | +Drush 4 | 4.x | 5.2.0+ | D5, D6, D7 | Unsupported +Drush 3 | 3.x | 5.2.0+ | D5, D6 | Unsupported + +Drush comes with a full test suite powered by [PHPUnit](https://github.com/sebastianbergmann/phpunit). Each commit gets tested by the awesome [Travis.ci continuous integration service](https://travis-ci.org/drush-ops/drush). + +USAGE +----------- + +Drush can be run in your shell by typing "drush" from within any Drupal root directory. + + $ drush [options] [argument1] [argument2] + +Use the 'help' command to get a list of available options and commands: + + $ drush help + +For even more documentation, use the 'topic' command: + + $ drush topic + +Installation instructions can be found below. For a full list of Drush commands +and documentation by version, visit http://www.drush.org. + + +SUPPORT +----------- + +Please take a moment to review the rest of the information in this file before +pursuing one of the support options below. + +* Post support requests to [Drupal Answers](http://drupal.stackexchange.com/questions/tagged/drush). +* Bug reports and feature requests should be reported in the [GitHub Drush Issue Queue](https://github.com/drush-ops/drush/issues). +* Use pull requests (PRs) to contribute to Drush. See [/CONTRIBUTING.md](CONTRIBUTING.md). +* It is still possible to search the old issue queue on Drupal.org for [fixed bugs](https://drupal.org/project/issues/search/drush?status%5B%5D=7&categories%5B%5D=bug), [unmigrated issues](https://drupal.org/project/issues/search/drush?status%5B%5D=5&issue_tags=needs+migration), [unmigrated bugs](https://drupal.org/project/issues/search/drush?status%5B%5D=5&categories%5B%5D=bug&issue_tags=needs+migration), and so on. + +MISC +----------- +* [www.drush.org](http://www.drush.org) +* [A list of modules that include Drush integration](http://drupal.org/project/modules?filters=tid%3A4654) +* For more information, please see the [Resources](http://drush.org/resources) and the [Drush FAQ](http://drupal.org/drush-faq). Run the `drush topic` command for even more help. +* If you are using Debian or Ubuntu, you can alternatively use the Debian packages uploaded in your distribution. You may need to use the backports to get the latest version, if you are running a LTS or "stable" release. +* For advice on using Drush with your ISP, see the hosting section of the Resources page on drush.org. + +REQUIREMENTS +----------- + +* To use Drush, you'll need a command line PHP version 5.3.3+. +* Drush commands that work with git require git 1.7 or greater. +* Drush works best on a Unix-like OS (Linux, OS X) +* Most Drush commands run on Windows. See INSTALLING DRUSH ON WINDOWS, below. + +INSTALL - PEAR +----------- +If you have trouble with PEAR installation, consider trying MANUAL INSTALLATION. It is not too hard. + +```bash +pear channel-discover pear.drush.org +pear install drush/drush +``` + +_Tip: Use sudo to overcome permission problems. If the channel-discover fails, try running the following sequence of commands:_ + +```bash +pear upgrade --force Console_Getopt +pear upgrade --force pear +pear upgrade-all +``` + +To update, run `pear upgrade drush/drush` + +To get alternate drush versions, replace that last line with one of the below that matches your fancy. + +```bash +pear install drush/drush-5.0.0 +pear install drush/drush-6.0.0RC4 +``` + +See the POST-INSTALL section for configuration tips. + +INSTALL - MANUAL +----------- +1. Place the uncompressed drush.tar.gz, drush.zip, or cloned git repository in a directory that is outside of your web root. +1. Make the 'drush' command executable: + + `$ chmod u+x /path/to/drush/drush` + +1. Configure your system to recognize where Drush resides. There are 2 options: + 1. Create a symbolic link to the Drush executable in a directory that is already in your PATH, e.g.: + + `$ ln -s /path/to/drush/drush /usr/bin/drush` + + 1. Explicitly add the Drush executable to the PATH variable which is defined in the the shell configuration file called .profile, .bash_profile, .bash_aliases, or .bashrc that is located in your home folder, i.e.: + + `export PATH="$PATH:/path/to/drush:/usr/local/bin"` + + Your system will search path options from left to right until it finds a result. + + To apply your changes to your current session, either log out and then log + back in again, or re-load your bash configuration file, i.e.: + + `$ source .bashrc` + + NOTE: If you do not follow step 3, you will need to inconveniently run Drush commands using the full path to the executable "/path/to/drush/drush" or by navigating to /path/to/drush and running "./drush". The -r or -l options will be required (see USAGE, below). + +1. Test that Drush is found by your system: + + `$ which drush` + +See the POST-INSTALL section for configuration tips. + +POST-INSTALL +----------------------- +1. See [example.bashrc](examples/example.bashrc) for instructions on how to add some + useful shell aliases that provides even tighter integration between + drush and bash. You may source this file directly into your shell by adding to + your .bashrc (or equivalent): source /path/to/drush/examples/example.bashrc + +1. If you didn't source it the step above, see top of + [drush.complete.sh](drush.complete.sh) file for instructions adding bash completion for drush + command to your shell. Once configured, completion works for site aliases, + command names, shell aliases, global options, and command-specific options. + +1. Optional. If [drush.complete.sh](drush.complete.sh) is being sourced (ideally in + bash_completion.d), you can use the supplied __drush_ps1() sh function to + add your current drush site (set with `drush use @sitename`) to your PS1 + prompt like so: + ```bash + if [ "\$(type -t __git_ps1)" ] && [ "\$(type -t __drush_ps1)" ]; then + PS1='\u@\h \w$(__git_ps1 " (%s)")$(__drush_ps1 "[%s]")\$ ' + fi + ``` + Putting this in a .bashrc/.bash_profile/.profile would produce this prompt: + + `msonnabaum@hostname ~/repos/drush (master)[@sitename]$` + +1. Help the Drush development team by sending anonymized usage statistics. To automatically send usage data, please add the following to a .drushrc.php file: + + ```php + $options['drush_usage_log'] = TRUE; + $options['drush_usage_send'] = TRUE; + ``` + + Stats are usually logged locally and sent whenever log file exceeds 50Kb. + Alternatively, one may disable automatic sending and instead use + `usage-show` and `usage-send` commands to more carefully send data. + + +ADDITIONAL CONFIGURATIONS FOR MAMP: +----------------------------------- + +Users of MAMP will need to manually specify in their PATH which version of php +and MySQL to use in the command line interface. This is independent of the php +version selected in the MAMP application settings. Under OS X, edit (or create +if it does not already exist) a file called .bash_profile in your home folder. + +To use php 5.3.x, add this line to .bash_profile: + + export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.3/bin:$PATH" + +If you want to use php 5.4.x, add this line instead: + + export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.4/bin:$PATH" + +If you have MAMP v.1.84 or lower, this configuration will work for both version +of PHP: + + export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5/bin:$PATH" + +If you have done this and are still getting a "no such file or directory" error +from PDO::__construct, try this: + +```bash + sudo mkdir /var/mysql + sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock +``` + +Additionally, you may need to adjust your php.ini settings before you can use +drush successfully. See CONFIGURING PHP.INI below for more details on how to +proceed. + +ADDITIONAL CONFIGURATIONS FOR OTHER AMP STACKS: +----------------------------------------------- + +Users of other Apache distributions such as XAMPP, or Acquia's Dev Desktop will +want to ensure that its php can be found by the command line by adding it to +the PATH variable, using the method in 3.b above. Depending on the version and +distribution of your AMP stack, PHP might reside at: + +Path | Application +----- | ---- +/Applications/acquia-drupal/php/bin | Acquia Dev Desktop (Mac) +/Applications/xampp/xamppfiles/bin | XAMP (Mac) +/opt/lampp/bin | XAMPP (Windows) + +Additionally, you may need to adjust your php.ini settings before you can use +drush successfully. See CONFIGURING PHP.INI below for more details on how to +proceed. + +RUNNING A SPECIFIC PHP FOR DRUSH +-------------------------- + + If you want to run Drush with a specific version of php, rather than the + php defined by your shell, you can add an environment variable to your + the shell configuration file called .profile, .bash_profile, .bash_aliases, + or .bashrc that is located in your home folder: + + export DRUSH_PHP='/path/to/php' + +CONFIGURING PHP.INI +------------------- + +Usually, php is configured to use separate php.ini files for the web server and +the command line. Make sure that Drush's php.ini is given as much memory to +work with as the web server is; otherwise, Drupal might run out of memory when +Drush bootstraps it. + +To see which php.ini file Drush is using, run: + + $ drush status + +To see which php.ini file the webserver is using, use the phpinfo() function in +a .php web page. See http://drupal.org/node/207036. + +If Drush is using the same php.ini file as the web server, you can create a +php.ini file exclusively for Drush by copying your web server's php.ini file to +the folder $HOME/.drush or the folder /etc/drush. Then you may edit this file +and change the settings described above without affecting the php enviornment +of your web server. + +Alternately, if you only want to override a few values, copy [example.drush.ini](examples/example.drush.ini) +from the /examples folder into $HOME/.drush or the folder /etc/drush and edit +to suit. See comments in example.drush.ini for more details. + +You may also use environment variables to control the php settings that Drush +will use. There are three options: + +```bash +export PHP_INI='/path/to/php.ini' +export DRUSH_INI='/path/to/drush.ini' +export PHP_OPTIONS='-d memory_limit="128M"' +``` + +In the case of PHP_INI and DRUSH_INI, these environment variables specify the +full path to a php.ini or drush.ini file, should you wish to use one that is +not in one of the standard locations described above. The PHP_OPTIONS +environment variable can be used to specify individual options that should +be passed to php on the command line when Drush is executed. + +Drush requires a fairly unrestricted php environment to run in. In particular, +you should insure that safe_mode, open_basedir, disable_functions and +disable_classes are empty. If you are using php 5.3.x, you may also need to +add the following definitions to your php.ini file: + +```ini +magic_quotes_gpc = Off +magic_quotes_runtime = Off +magic_quotes_sybase = Off +``` + +INSTALLING DRUSH ON WINDOWS: +---------------------------- + +Windows support has improved, but is still lagging. For full functionality, +consider using on Linux/Unix/OSX using Virtualbox or other virtual machine. + +There is a Windows msi installer for drush available at http://www.drush.org/drush_windows_installer. + +Please see that page for more information on running Drush on Windows. + +Whenever the documentation or the help text refers to 'drush [option] +' or something similar, 'drush' may need to be replaced by +'drush.bat'. + +Additional Drush Windows installation documentation can be found at +http://drupal.org/node/594744. + +Most Drush commands will run in a Windows CMD shell or PowerShell, but the +Git Bash shell provided by the 'Git for Windows' installation is the preferred +shell in which to run Drush commands. For more information on "Git for Windows' +visit http://msysgit.github.com/. + +When creating aliases for Windows remote machines, pay particular attention to +information presented in the example.aliases.drushrc.php file, especially when +setting values for 'remote-host' and 'os', as these are very important when +running Drush rsync and Drush sql-sync commands. + + +OPTIONS +----------- + +For multisite installations, use the -l option to target a particular site. If +you are outside the Drupal web root, you might need to use the -r, -l or other +command line options just for Drush to work. If you do not specify a URI with +-l and Drush falls back to the default site configuration, Drupal's +$GLOBAL['base_url'] will be set to http://default. This may cause some +functionality to not work as expected. + + $ drush -l http://example.com pm-update + +Related Options: + ``` + -r , --root= Drupal root directory to use + (defaults to current directory or anywhere in a + Drupal directory tree) + -l , --uri= URI of the Drupal site to use + -v, --verbose Display verbose output. + ``` + +Very intensive scripts can exhaust your available PHP memory. One remedy is to +just restart automatically using bash. For example: + + while true; do drush search-index; sleep 5; done + + +DRUSH CONFIGURATION FILES +----------- + +Inside the [examples](examples) directory you will find some example files to help you get +started with your Drush configuration file (example.drushrc.php), site alias +definitions (example.aliases.drushrc.php) and Drush commands +(sandwich.drush.inc). You will also see an example 'policy' file which can be +customized to block certain commands or arguments as required by your +organization's needs. + +DRUSHRC.PHP +----------- + +If you get tired of typing options all the time you can contain them in a +drushrc.php file. Multiple Drush configuration files can provide the +flexibility of providing specific options in different site directories of a +multi-site installation. See [example.drushrc.php](examples/example.drushrc.php) for examples and installation +details. + +SITE ALIASES +------------ + +Drush lets you run commands on a remote server, or even on a set of remote +servers. Once defined, aliases can be references with the @ nomenclature, i.e. + +```bash +# Synchronize staging files to production +$ drush rsync @staging:%files/ @live:%files +# Syncronize database from production to dev, excluding the cache table +$ drush sql-sync --structure-tables-key=custom --no-cache @live @dev +``` + +See http://drupal.org/node/670460 and [example.aliases.drushrc.php](examples/example.aliases.drushrc.php) for more +information. + +COMMANDS +-------- + +Drush can be extended to run your own commands. Writing a Drush command is no harder than writing simple Drupal modules, since they both follow the same structure. + +See [sandwich.drush.inc](examples/sandwich.drush.inc) for a quick tutorial on Drush command files. Otherwise, the core commands in Drush are good models for your own commands. + +You can put your Drush command file in a number of places: + + 1. In a folder specified with the --include option (see `drush topic + docs-configuration`). + 1. Along with one of your enabled modules. If your command is related to an + existing module, this is the preferred approach. + 1. In a .drush folder in your HOME folder. Note, that you have to create the + .drush folder yourself. + 1. In the system-wide Drush commands folder, e.g. /usr/share/drush/commands. + 1. In Drupal's /drush or sites/all/drush folders. Note, that you have to create the + drush folder yourself. + +In any case, it is important that you end the filename with ".drush.inc", so that Drush can find it. + + +FAQ +------ + +``` + Q: What does "drush" stand for? + A: The Drupal Shell. + + Q: How do I pronounce Drush? + A: Some people pronounce the dru with a long u like Drupal. Fidelity points + go to them, but they are in the minority. Most pronounce Drush so that it + rhymes with hush, rush, flush, etc. This is the preferred pronunciation. + + Q: Does Drush have unit tests? + A: Drush has an excellent suite of unit tests. See the README.md file in the /tests subdirectory for + more information. +``` + +CREDITS +----------- + +* Originally developed by [Arto Bendiken](http://bendiken.net) for Drupal 4.7. +* Redesigned by [Franz Heinzmann](http://unbiskant.org) in May 2007 for Drupal 5. +* Maintained by [Moshe Weitzman](http://drupal.org/moshe) with much help from + Owen Barton, greg.1.anderson, jonhattan, Mark Sonnabaum, and Jonathan Hedstrom. + +![Drush Logo](drush_logo-black.png) diff -Nru drush-5.9/README.txt drush-5.10.0/README.txt --- drush-5.9/README.txt 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ - -DESCRIPTION -=========== - -Drush is a command line shell and Unix scripting interface for Drupal. If you -are unfamiliar with shell scripting, reviewing the documentation for your shell -(e.g. man bash) or reading an online tutorial (e.g. search for "bash tutorial") -will help you get the most out of Drush. - -Drush core ships with lots of useful commands for interacting with code like -modules/themes/profiles. Similarly, it runs update.php, executes sql queries -and DB migrations, and misc utilities like run cron or clear cache. - - -REQUIREMENTS -============ - -* To use Drush from the command line, you'll need a CLI-mode capable PHP binary - version 5.2 or greater. - -* Drush commands that work with git require git 1.7 or greater. - -* Drush is designed for a Unix-like OS (Linux, OS X). - -* Most Drush commands run on Windows. See INSTALLING DRUSH ON WINDOWS, below. - -* This version of Drush works with Drupal 6 and Drupal 7. - - -INSTALLATION -============ - -The preferred way to install Drush is via our PEAR channel. See instructions at -http://drupal.org/project/drush. If you prefer a more manual install, see -below. - -1. Place the uncompressed drush.tar.gz, drush.zip, or cloned git repository in - a directory that is outside of your web root. - -2. Make the 'drush' command executable: - - $ chmod u+x /path/to/drush/drush - -3. Configure your system to recognize where Drush resides. There are 2 options: - - a) create a symbolic link to the Drush executable in a directory that is - already in your PATH, e.g.: - - $ ln -s /path/to/drush/drush /usr/bin/drush - - b) explicitly add the Drush executable to the PATH variable which is defined - in the the shell configuration file called .profile, .bash_profile, - .bash_aliases, or .bashrc that is located in your home folder, i.e.: - - export PATH="$PATH:/path/to/drush:/usr/local/bin" - - Your system will search path options from left to right until it finds a - result. - - To apply your changes to your current session, either log out and then log - back in again, or re-load your bash configuration file, i.e.: - - $ source .bashrc - - NOTE: If you do not follow step 3, you will need to inconveniently run Drush - commands using the full path to the executable "/path/to/drush/drush" or by - navigating to /path/to/drush and running "./drush". The -r or -l options will - be required (see USAGE, below). - -4. Test that Drush is found by your system: - - $ which drush - -5. Optional. Help the Drush development team by sending anonymized usage - statistics. To automatically send usage data, please add the following to a - .drushrc.php file: - - $options['drush_usage_log'] = TRUE; - $options['drush_usage_send'] = TRUE; - - Stats are usually logged locally and sent whenever log file exceeds 50Kb. - Alternatively, one may disable automatic sending and instead use usage-view - and usage-send commands to more carefully send data. - -6. Optional. See examples/example.bashrc for instructions on how to add some - useful shell aliases that provides even tighter integration between - drush and bash. You may source this file directly into your shell by adding to - your .bashrc (rr equivalent): source /path/to/drush/examples/example.bashrc - -7. Optional. If you didn't source it in Step 6 above, see top of - drush.complete.sh file for instructions adding bash completion for drush - command to your shell. Once configured, completion works for site aliases, - command names, shell aliases, global options, and command-specific options. - -8. Optional. If drush.complete.sh is being sourced (ideally in - bash_completion.d), you can use the supplied __drush_ps1() sh function to - add your current drush site (set with `drush use @sitename`) to your PS1 - prompt like so: - - if [ "\$(type -t __git_ps1)" ] && [ "\$(type -t __drush_ps1)" ]; then - PS1='\u@\h \w$(__git_ps1 " (%s)")$(__drush_ps1 "[%s]")\$ ' - fi - - Putting this in a .bashrc/.bash_profile/.profile would produce this prompt: - - msonnabaum@hostname ~/repos/drush (master)[@sitename]$ - -ADDITIONAL CONFIGURATIONS FOR MAMP: ------------------------------------ - -Users of MAMP will need to manually specify in their PATH which version of php -and MySQL to use in the command line interface. This is independent of the php -version selected in the MAMP application settings. Under OS X, edit (or create -if it does not already exist) a file called .bash_profile in your home folder. - -To use php 5.2.x, add this line to .bash_profile: - - export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.2/bin:$PATH" - -If you want to use php 5.3.x, add this line instead: - - export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.3/bin:$PATH" - -If you have MAMP v.1.84 or lower, this configuration will work for both version -of PHP: - - export PATH="/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5/bin:$PATH" - -If you have done this and are still getting a "no such file or directory" error -from PDO::__construct, try this: - - sudo mkdir /var/mysql - sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock - -Additionally, you may need to adjust your php.ini settings before you can use -drush successfully. See CONFIGURING PHP.INI below for more details on how to -proceed. - -ADDITIONAL CONFIGURATIONS FOR OTHER AMP STACKS: ------------------------------------------------ - -Users of other Apache distributions such as XAMPP, or Acquia's Dev Desktop will -want to ensure that its php can be found by the command line by adding it to -the PATH variable, using the method in 3.b above. Depending on the version and -distribution of your AMP stack, PHP might reside at: - - /Applications/acquia-drupal/php/bin Acquia Dev Desktop (Mac) - /Applications/xampp/xamppfiles/bin XAMP (Mac) - /opt/lampp/bin XAMPP (Windows) - -Additionally, you may need to adjust your php.ini settings before you can use -drush successfully. See CONFIGURING PHP.INI below for more details on how to -proceed. - -CUSTOM CONFIGURATIONS: ----------------------- - -Running a specific php-cli version for Drush -- - - - - - - - - - - - - - - - - - - - - - - - - If you want to run Drush with a specific version of php, rather than the - php-cli defined by your system, you can add an environment variable to your - the shell configuration file called .profile, .bash_profile, .bash_aliases, - or .bashrc that is located in your home folder: - - export DRUSH_PHP='/path/to/php' - -CONFIGURING PHP.INI -------------------- - -Usually, php is configured to use separate php.ini files for the web server and -the command line. Make sure that Drush's php.ini is given as much memory to -work with as the web server is; otherwise, Drupal might run out of memory when -Drush bootstraps it. - -To see which php.ini file Drush is using, run: - - $ drush status - -To see which php.ini file the webserver is using, use the phpinfo() function in -a .php web page. See http://drupal.org/node/207036. - -If Drush is using the same php.ini file as the web server, you can create a -php.ini file exclusively for Drush by copying your web server's php.ini file to -the folder $HOME/.drush or the folder /etc/drush. Then you may edit this file -and change the settings described above without affecting the php enviornment -of your web server. - -Alternately, if you only want to override a few values, copy example.drush.ini -from the "examples" folder into $HOME/.drush or the folder /etc/drush and edit -to suit. See comments in example.drush.ini for more details. - -You may also use environment variables to control the php settings that Drush -will use. There are three options: - - export PHP_INI='/path/to/php.ini' - - export DRUSH_INI='/path/to/drush.ini' - - export PHP_OPTIONS='-d memory_limit="128M"' - -In the case of PHP_INI and DRUSH_INI, these environment variables specify the -full path to a php.ini or drush.ini file, should you wish to use one that is -not in one of the standard locations described above. The PHP_OPTIONS -environment variable can be used to specify individual options that should -be passed to php on the command line when Drush is executed. - -Drush requires a fairly unrestricted php environment to run in. In particular, -you should insure that safe_mode, open_basedir, disable_functions and -disable_classes are empty. - -INSTALLING DRUSH ON WINDOWS: ----------------------------- - -Windows support has improved, but is still lagging. For full functionality, -consider using on Linux/Unix/OSX using Virtualbox or other virtual machine. - -There is a Windows msi installer for drush available at: - - http://www.drush.org/drush_windows_installer. - -Please see that page for more information on running Drush on Windows. - -Whenever the documentation or the help text refers to 'drush [option] -' or something similar, 'drush' may need to be replaced by -'drush.bat'. - -Additional Drush Windows installation documentation can be found at -http://drupal.org/node/594744. - -Most Drush commands will run in a Windows CMD shell or PowerShell, but the -Git Bash shell provided by the 'Git for Windows' installation is the preferred -shell in which to run Drush commands. For more information on "Git for Windows' -visit http://msysgit.github.com/. - -When creating aliases for Windows remote machines, pay particular attention to -information presented in the example.aliases.drushrc.php file, especially when -setting values for 'remote-host' and 'os', as these are very important when -running Drush rsync and Drush sql-sync commands. - - -USAGE -===== - -Once you have completed the installation steps, Drush can be run in your shell -by typing "drush" from within any Drupal root directory. - - $ drush [options] [argument1] [argument2] - -Use the 'help' command to get a list of available options and commands: - - $ drush help - -For even more documentation, use the 'topic' command: - - $ drush topic - -For a full list of Drush commands and documentation by version, visit -http://drush.ws. - -Many commands support a --pipe option which returns machine readable output. -For example, return a list of enabled modules: - - $ drush pm-list --type=module --status=enabled --pipe - -For multisite installations, use the -l option to target a particular site. If -you are outside the Drupal web root, you might need to use the -r, -l or other -command line options just for Drush to work. If you do not specify a URI with --l and Drush falls back to the default site configuration, Drupal's -$GLOBAL['base_url'] will be set to http://default. This may cause some -functionality to not work as expected. - - $ drush -l http://example.com pm-update - -Related Options: - -r , --root= Drupal root directory to use - (defaults to current directory or anywhere in a - Drupal directory tree) - -l , --uri= URI of the Drupal site to use - -v, --verbose Display verbose output. - -Very intensive scripts can exhaust your available PHP memory. One remedy is to -just restart automatically using bash. For example: - - while true; do drush search-index; sleep 5; done - - -DRUSH CONFIGURATION FILES -========================= - -Inside /path/to/drush/examples you will find some example files to help you get -started with your Drush configuration file (example.drushrc.php), site alias -definitions (example.aliases.drushrc.php) and Drush commands -(sandwich.drush.inc). You will also see an example 'policy' file which can be -customized to block certain commands or arguments as required by your -organization's needs. - -DRUSHRC.PHP ------------ - -If you get tired of typing options all the time you can contain them in a -drushrc.php file. Multiple Drush configuration files can provide the -flexibility of providing specific options in different site directories of a -multi-site installation. See example.drushrc.php for examples and installation -details. - -SITE ALIASES ------------- - -Drush lets you run commands on a remote server, or even on a set of remote -servers. Once defined, aliases can be references with the @ nomenclature, i.e. - - # Syncronize staging files to production - $ drush rsync @staging:%files/ @live:%files - - # Syncronize database from production to dev, excluding the cache table - $ drush sql-sync --structure-tables-key=custom --no-cache @live @dev - -See http://drupal.org/node/670460 and example.aliases.drushrc.php for more -information. - -COMMANDS --------- - -Drush can be extended to run your own commands. Writing a Drush command is no -harder than writing simple Drupal modules, since they both follow the same -structure. - -See examples/sandwich.drush.inc for light details on the internals of a Drush -command file. Otherwise, the core commands in Drush are good models for your -own commands. - -You can put your Drush command file in a number of places: - - a) In a folder specified with the --include option (see `drush topic - docs-configuration`). - - b) Along with one of your enabled modules. If your command is related to an - existing module, this is the preferred approach. - - c) In a .drush folder in your HOME folder. Note, that you have to create the - .drush folder yourself. - - d) In the system-wide Drush commands folder, e.g. /usr/share/drush/commands. - - e) In Drupal's sites/all/drush folder. Note, that you have to create the - drush folder yourself. - -In any case, it is important that you end the filename with ".drush.inc", so -that Drush can find it. - - -FAQ -=== - - Q: What does "drush" stand for? - A: The Drupal Shell. - - Q: How do I pronounce Drush? - A: Some people pronounce the dru with a long u like Drupal. Fidelity points - go to them, but they are in the minority. Most pronounce Drush so that it - rhymes with hush, rush, flush, etc. This is the preferred pronunciation. - - -CREDITS -======= - -* Originally developed by Arto Bendiken for Drupal 4.7. -* Redesigned by Franz Heinzmann (frando) in May 2007 for Drupal 5. -* Maintained by Moshe Weitzman with much help from - Owen Barton, greg.1.anderson, jonhattan, Mark Sonnabaum, and Jonathan Hedstrom. diff -Nru drush-5.9/commands/core/archive.drush.inc drush-5.10.0/commands/core/archive.drush.inc --- drush-5.9/commands/core/archive.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/archive.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -186,7 +186,7 @@ // Add sites/all to the same archive. drush_shell_cd_and_exec($workdir, "$tar {$tar_extra_options} {$dereference}-rf %s %s", $destination, "{$docroot}/sites/all"); // Add special files in sites/ to the archive. - $files_to_add = array('sites/README.txt', 'sites/sites.php', 'sites/example.sites.php', 'sites/default/default.settings.php'); + $files_to_add = array('sites/README.txt', 'sites/sites.php', 'sites/example.sites.php'); foreach ($files_to_add as $file_to_add) { if (file_exists($file_to_add)) { drush_shell_cd_and_exec($workdir, "$tar {$dereference}-rf %s %s", $destination, $docroot . '/' . $file_to_add); diff -Nru drush-5.9/commands/core/cache.drush.inc drush-5.10.0/commands/core/cache.drush.inc --- drush-5.9/commands/core/cache.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/cache.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -219,7 +219,7 @@ drupal_theme_rebuild(); } else { - drush_db_delete('cache', 'cid LIKE :theme_registry', array(':theme_registry' => 'theme_registry%')); + cache_clear_all('theme_registry', 'cache', TRUE); } } diff -Nru drush-5.9/commands/core/core.drush.inc drush-5.10.0/commands/core/core.drush.inc --- drush-5.9/commands/core/core.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/core.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -63,6 +63,7 @@ $items['core-cron'] = array( 'description' => 'Run all cron hooks in all active modules for specified site.', 'aliases' => array('cron'), + 'topics' => array('core-cron'), ); $items['updatedb'] = array( 'description' => 'Apply any database updates required (as with running update.php).', @@ -103,6 +104,10 @@ 'options' => array( 'show-passwords' => 'Show database password.', 'full' => 'Show all drush aliases in the report, even if there are a lot.', + 'project' => array( + 'description' => 'One or more projects that should be added to the path list', + 'example-value' => 'foo,bar', + ), ), 'topics' => array('docs-readme'), ); @@ -393,15 +398,8 @@ return FALSE; } - if (drush_drupal_major_version() <= 6) { - // Clear all caches in a new process. We just performed major surgery. - drush_invoke_process('@self', 'cache-clear', array('all')); - } - else { - // Should be unnecessary on D7. - // On D7 site-upgrade, this cache_clear was leading to: - // Call to undefined function field_read_fields() in field_sql_storage.install line 17 - } + // Clear all caches in a new process. We just performed major surgery. + drush_invoke_process('@self', 'cache-clear', array('all')); drush_log(dt('Finished performing updates.'), 'ok'); } @@ -604,15 +602,7 @@ } /** - * Command callback. Runs cron hooks. - * - * This is where the action takes place. - * - * In this function, all of Drupals API is (usually) available, including - * any functions you have added in your own modules/themes. - * - * To print something to the terminal window, use drush_print(). - * + * Command callback. Runs all cron hooks. */ function drush_core_cron() { if (drupal_cron_run()) { diff -Nru drush-5.9/commands/core/docs.drush.inc drush-5.10.0/commands/core/docs.drush.inc --- drush-5.9/commands/core/docs.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/docs.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -34,12 +34,12 @@ // any other command). // $items['docs-readme'] = array( - 'description' => 'README.txt', + 'description' => 'README.md', 'hidden' => TRUE, 'topic' => TRUE, 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, 'callback' => 'drush_print_file', - 'callback arguments' => array($docs_dir . '/README.txt'), + 'callback arguments' => array($docs_dir . '/README.md'), ); $items['docs-bashrc'] = array( 'description' => 'Bashrc customization examples for Drush.', diff -Nru drush-5.9/commands/core/rsync.core.inc drush-5.10.0/commands/core/rsync.core.inc --- drush-5.9/commands/core/rsync.core.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/rsync.core.inc 2013-09-26 16:05:05.000000000 +0000 @@ -135,9 +135,9 @@ } $mode = '-akz'; - // Process --include-path and --exclude-path options the same way + // Process --include-paths and --exclude-paths options the same way foreach (array('include', 'exclude') as $include_exclude) { - // Get the option --include-path or --exclude-path and explode to an array of paths + // Get the option --include-paths or --exclude-paths and explode to an array of paths // that we will translate into an --include or --exclude option to pass to rsync $inc_ex_path = explode(PATH_SEPARATOR, drush_get_option($include_exclude . '-paths', '')); foreach ($inc_ex_path as $one_path_to_inc_ex) { diff -Nru drush-5.9/commands/core/search.drush.inc drush-5.10.0/commands/core/search.drush.inc --- drush-5.9/commands/core/search.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/search.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -66,6 +66,7 @@ function _drush_search_index() { list($remaining, ) = _drush_search_status(); register_shutdown_function('search_update_totals'); + $failures = 0; while ($remaining > 0) { drush_log(dt('Remaining items to be indexed: ' . $remaining), 'ok'); // Use drush_invoke_process() to start subshell. Avoids out of memory issue. @@ -95,7 +96,22 @@ $eval .= " module_invoke_all('update_index');"; } drush_invoke_process('@self', 'php-eval', array($eval)); + $previous_remaining = $remaining; list($remaining, ) = _drush_search_status(); + // Make sure we're actually making progress. + if ($remaining == $previous_remaining) { + $failures++; + if ($failures == 3) { + drush_log(dt('Indexing stalled with @number items remaining.', array( + '@number' => $remaining, + )), 'error'); + return; + } + } + // Only count consecutive failures. + else { + $failures = 0; + } } } diff -Nru drush-5.9/commands/core/sitealias.drush.inc drush-5.10.0/commands/core/sitealias.drush.inc --- drush-5.9/commands/core/sitealias.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/sitealias.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -350,6 +350,16 @@ } /** + * Validation callback for drush site-set. + */ +function drush_sitealias_site_set_validate() { + if (!function_exists('posix_getppid')) { + $args = array('!command' => 'site-set', '!dependencies' => 'POSIX'); + return drush_set_error('DRUSH_COMMAND_PHP_DEPENDENCY_ERROR', dt('Command !command needs the following PHP extensions installed/enabled to run: !dependencies.', $args)); + } +} + +/** * Set the DRUPAL_SITE variable by writing it out to a temporary file that we * then source for persistent site switching. * diff -Nru drush-5.9/commands/core/test.drush.inc drush-5.10.0/commands/core/test.drush.inc --- drush-5.9/commands/core/test.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/core/test.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -77,7 +77,7 @@ * Test-run command callback. * * @specs - * A comman delimited string of test classes or group names. + * A comma delimited string of test classes or group names. */ function drush_test_run($specs = NULL) { if (drush_drupal_major_version() > 7) { diff -Nru drush-5.9/commands/make/make.download.inc drush-5.10.0/commands/make/make.download.inc --- drush-5.9/commands/make/make.download.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/make/make.download.inc 2013-09-26 16:05:05.000000000 +0000 @@ -10,10 +10,10 @@ * @return mixed * The destination path on success, FALSE on failure. */ -function make_download_factory($name, $download, $download_location) { +function make_download_factory($name, $type, $download, $download_location) { $function = 'make_download_' . $download['type']; if (function_exists($function)) { - return $function($name, $download, $download_location); + return $function($name, $type, $download, $download_location); } else { return FALSE; @@ -23,7 +23,7 @@ /** * Download project using drush's pm-download command. */ -function make_download_pm($name, $download, $download_location) { +function make_download_pm($name, $type, $download, $download_location) { $full_project_version = $name . '-' . $download['full_version']; $options = array( @@ -33,10 +33,10 @@ 'source' => $download['status url'], // This is only relevant for profiles, but we always want the variant to // be 'profile-only' so we don't end up with extra copies of core. - 'variant' => 'profile-only', + 'variant' => $type == 'core' ? 'full' : 'profile-only', 'cache' => TRUE, ); - if ($name == 'drupal') { + if ($type == 'core') { $options['drupal-project-rename'] = basename($download_location); } if (drush_get_option('no-cache', FALSE)) { @@ -64,7 +64,7 @@ * @return mixed * The destination directory on success, FALSE on failure. */ -function make_download_file($name, $download, $download_location, $cache_duration = DRUSH_CACHE_LIFETIME_DEFAULT) { +function make_download_file($name, $type, $download, $download_location, $cache_duration = DRUSH_CACHE_LIFETIME_DEFAULT) { if ($filename = _make_download_file($download['url'], $cache_duration)) { if (!drush_get_option('ignore-checksums') && !_make_verify_checksums($download, $filename)) { return FALSE; @@ -190,8 +190,8 @@ /** * For backwards compatibility. */ -function make_download_get($name, $download, $download_location) { - return make_download_file($name, $download, $download_location); +function make_download_get($name, $type, $download, $download_location) { + return make_download_file($name, $type, $download, $download_location); } /** @@ -213,7 +213,7 @@ * @return mixed * The download location on success, FALSE otherwise. */ -function make_download_git($name, $download, $download_location) { +function make_download_git($name, $type, $download, $download_location) { $tmp_path = make_tmp(); $wc = drush_get_option('working-copy'); // If no download URL specified, assume anonymous clone from git.drupal.org. @@ -307,7 +307,7 @@ // If not, see if we at least have a branch. elseif (!empty($download['branch'])) { - if (drush_shell_exec("git checkout %s", $download['branch'])) { + if (drush_shell_exec("git checkout %s", $download['branch']) && (trim(implode(drush_shell_exec_output())) != '')) { drush_log(dt("Checked out branch @branch.", array('@branch' => $download['branch'])), 'ok'); } elseif (drush_shell_exec("git checkout -b %s %s", $download['branch'], 'origin/' . $download['branch'])) { @@ -346,7 +346,7 @@ * @return mixed * The download location on success, FALSE otherwise. */ -function make_download_bzr($name, $download, $download_location) { +function make_download_bzr($name, $type, $download, $download_location) { $tmp_path = make_tmp(); $tmp_location = drush_tempdir() . '/' . basename($download_location); if (!empty($download['url'])) { @@ -392,7 +392,7 @@ * @return mixed * The download location on success, FALSE otherwise. */ -function make_download_svn($name, $download, $download_location) { +function make_download_svn($name, $type, $download, $download_location) { if (!empty($download['url'])) { if (!empty($download['interactive'])) { $function = 'drush_shell_exec_interactive'; diff -Nru drush-5.9/commands/make/make.drush.inc drush-5.10.0/commands/make/make.drush.inc --- drush-5.9/commands/make/make.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/make/make.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -38,7 +38,7 @@ 'options' => array( 'version' => 'Print the make API version and exit.', 'concurrency' => array( - 'description' => 'Limits the number of concurrent projects that will be processed at the same time. The default is 4.', + 'description' => 'Set the number of concurrent projects that will be processed at the same time. The default is 1.', 'example-value' => '1', ), 'contrib-destination' => 'Specify a path under which modules and themes should be placed. Defaults to sites/all.', @@ -185,6 +185,8 @@ return FALSE; } + drush_log(dt('Beginning to build !makefile.', array('!makefile' => $makefile)), 'ok'); + if (make_projects(FALSE, drush_get_option('contrib-destination', 'sites/all'), $info, $build_path)) { make_libraries(drush_get_option('contrib-destination', 'sites/all'), $info, $build_path); @@ -356,8 +358,10 @@ $release = release_info_fetch($request); // Restore the previous '--cache' option value. drush_set_option('cache', $cache_before); - // Translate release_info key for project_type to drush make. - $project['type'] = $request['project_type']; + if (!isset($project['type'])) { + // Translate release_info key for project_type to drush make. + $project['type'] = $request['project_type']; + } if (!isset($project['download'])) { $project['download'] = array( 'type' => 'pm', @@ -407,7 +411,7 @@ if (!empty($invocations)) { // Backend options. $backend_options = array( - 'concurrency' => drush_get_option('concurrency', 4), + 'concurrency' => drush_get_option('concurrency', 1), 'method' => 'POST', ); @@ -524,6 +528,14 @@ $ret = drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . '__build__', $tmp_path . DIRECTORY_SEPARATOR . basename($build_path), TRUE); $ret = $ret && drush_copy_dir($tmp_path . DIRECTORY_SEPARATOR . basename($build_path), $build_path); } + + // Copying to final destination resets write permissions. Re-apply. + if (drush_get_option('prepare-install')) { + $default = $build_path . '/sites/default'; + chmod($default . '/settings.php', 0666); + chmod($default . '/files', 0777); + } + if (!$ret) { drush_set_error('MAKE_CANNOT_MOVE_BUILD', dt("Cannot move build into place")); } diff -Nru drush-5.9/commands/make/make.project.inc drush-5.10.0/commands/make/make.project.inc --- drush-5.9/commands/make/make.project.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/make/make.project.inc 2013-09-26 16:05:05.000000000 +0000 @@ -122,7 +122,7 @@ $this->download['full_version'] = $full_version; } - if (make_download_factory($this->name, $this->download, $this->download_location) === FALSE) { + if (make_download_factory($this->name, $this->type, $this->download, $this->download_location) === FALSE) { $this->downloaded = FALSE; } return $this->downloaded; diff -Nru drush-5.9/commands/pm/package_handler/wget.inc drush-5.10.0/commands/pm/package_handler/wget.inc --- drush-5.9/commands/pm/package_handler/wget.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/pm/package_handler/wget.inc 2013-09-26 16:05:05.000000000 +0000 @@ -37,14 +37,16 @@ function package_handler_download_project(&$request, $release) { // Install profiles come in several variants. User may specify which one she wants. if ($request['project_type'] == 'profile') { - // @todo Use xpath to get the right file url. - $files = $release['files']; - foreach ($files as $key => $file) { - if ((string)$file->variant == drush_get_option('variant', 'full') && (string)$file->archive_type == 'tar.gz') { - $release['download_link'] = (string)$file->url; - $release['mdhash'] = (string)$file->md5; - $release['date'] = (string)$file->filedate; - break; + if (!empty($release['files'])) { + // @todo Use xpath to get the right file url. + $files = $release['files']; + foreach ($files as $key => $file) { + if ((string)$file->variant == drush_get_option('variant', 'full') && (string)$file->archive_type == 'tar.gz') { + $release['download_link'] = (string)$file->url; + $release['mdhash'] = (string)$file->md5; + $release['date'] = (string)$file->filedate; + break; + } } } } diff -Nru drush-5.9/commands/pm/pm.drush.inc drush-5.10.0/commands/pm/pm.drush.inc --- drush-5.9/commands/pm/pm.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/pm/pm.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -86,7 +86,10 @@ $update = 'update'; $update_options = array( 'security-only' => 'Only update modules that have security updates available. However, if there were other releases of a module between the installed version the security update, other changes to features or functionality may occur.', - 'lock' => 'Add a persistent lock to remove the specified projects from consideration during updates. Locks may be removed with the --unlock parameter, or overridden by specifically naming the project as a parameter to pm-update or pm-updatecode. The lock does not affect pm-download. See also the update_advanced project for similar and improved functionality.', + 'lock' => array( + 'description' => 'Add a persistent lock to remove the specified projects from consideration during updates. Locks may be removed with the --unlock parameter, or overridden by specifically naming the project as a parameter to pm-update or pm-updatecode. The lock does not affect pm-download. See also the update_advanced project for similar and improved functionality.', + 'example-value' => 'foo,bar', + ), ); $update_suboptions = array( 'lock' => array( @@ -94,7 +97,10 @@ 'description' => 'A brief message explaining why a project is being locked; displayed during pm-updatecode. Optional.', 'example-value' => 'message', ), - 'unlock' => 'Remove the persistent lock from the specified projects so that they may be updated again.', + 'unlock' => array( + 'description' => 'Remove the persistent lock from the specified projects so that they may be updated again.', + 'example-value' => 'foo,bar', + ), ), ); @@ -168,6 +174,7 @@ 'pipe' => 'Returns a whitespace delimited list of projects with any of its extensions enabled and their respective version and update information, one project per line. Order: project name, current version, recommended version, update status.', 'notes' => 'Show release notes for each project to be updated.', 'no-core' => 'Only update modules and skip the core update.', + 'check-updatedb' => 'Check to see if an updatedb is needed after updating the code. Default is on; use --check-updatedb=0 to disable.', ) + $update_options, 'sub-options' => $update_suboptions, 'aliases' => array('upc'), @@ -744,7 +751,7 @@ // If we can find info on a project that has the same name // as the requested extension, then we'll call that a match. $request = pm_parse_project_version(array($extension)); - if (release_info_check_project($request[$extension], 'module')) { + if (release_info_check_project($request[$extension])) { $result = $extension; } } @@ -767,13 +774,31 @@ // Classify $args in themes, modules or unknown. $modules = array(); $themes = array(); + $download = array(); drush_pm_classify_extensions($args, $modules, $themes, $extension_info); $extensions = array_merge($modules, $themes); $unknown = array_diff($args, $extensions); - // Discard and set an error for each unknown extension. - foreach ($unknown as $name) { - drush_log(dt('!extension was not found and will not be enabled.', array('!extension' => $name)), 'warning'); + // If there're unknown extensions, try and download projects + // with matching names. + if (!empty($unknown)) { + $found = array(); + foreach ($unknown as $key => $name) { + drush_log(dt('!extension was not found.', array('!extension' => $name)), 'warning'); + $project = drush_pm_find_project_from_extension($name); + if (!empty($project)) { + $found[] = $project; + } + } + if (!empty($found)) { + drush_log(dt("The following projects provide some or all of the extensions not found:\n@list", array('@list' => implode("\n", $found))), 'ok'); + if (drush_get_option('resolve-dependencies')) { + drush_log(dt("They are being downloaded."), 'ok'); + } + if ((drush_get_option('resolve-dependencies')) || (drush_confirm("Would you like to download them?"))) { + $download = $found; + } + } } // Discard already enabled and incompatible extensions. @@ -782,8 +807,8 @@ drush_log(dt('!extension is already enabled.', array('!extension' => $name)), 'ok'); } // Check if the extension is compatible with Drupal core and php version. - if (drush_extension_check_incompatibility($extension_info[$name])) { - drush_set_error('DRUSH_PM_ENABLE_MODULE_INCOMPATIBLE', dt('!name is incompatible with the Drupal version.', array('!name' => $name))); + if ($component = drush_extension_check_incompatibility($extension_info[$name])) { + drush_set_error('DRUSH_PM_ENABLE_MODULE_INCOMPATIBLE', dt('!name is incompatible with the !component version.', array('!name' => $name, '!component' => $component))); if ($extension_info[$name]->type == 'module') { unset($modules[$name]); } @@ -814,24 +839,28 @@ $unmet_project_list = array_merge($unmet_project_list, $unmet_projects); $msgs[] = dt("!module requires !unmet-projects", array('!unmet-projects' => implode(', ', $unmet_projects), '!module' => $module)); } - if (drush_get_option('resolve-dependencies') || drush_confirm(dt("The following projects have unmet dependencies:\n!list\nWould you like to download them?", array('!list' => implode("\n", $msgs))))) { - // If we did not already print a log message via drush_confirm, then print one now. - if (drush_get_option('resolve-dependencies')) { - drush_log(dt("The following projects have unmet dependencies:\n@list\nThey are being downloaded.", array('@list' => implode("\n", $msgs)))); - } - // Disable DRUSH_AFFIRMATIVE context temporarily. - $drush_affirmative = drush_get_context('DRUSH_AFFIRMATIVE'); - drush_set_context('DRUSH_AFFIRMATIVE', FALSE); - // Invoke a new process to download dependencies. - $result = drush_invoke_process('@self', 'pm-download', $unmet_project_list, array(), array('interactive' => TRUE)); - // Restore DRUSH_AFFIRMATIVE context. - drush_set_context('DRUSH_AFFIRMATIVE', $drush_affirmative); - // Refresh module cache after downloading the new modules. - $extension_info = drush_get_extensions(); - $recheck = TRUE; + drush_log(dt("The following projects have unmet dependencies:\n!list", array('!list' => implode("\n", $msgs))), 'ok'); + if (drush_get_option('resolve-dependencies')) { + drush_log(dt("They are being downloaded."), 'ok'); + } + if (drush_get_option('resolve-dependencies') || drush_confirm(dt("Would you like to download them?"))) { + $download = array_merge($download, $unmet_project_list); } } } + + if (!empty($download)) { + // Disable DRUSH_AFFIRMATIVE context temporarily. + $drush_affirmative = drush_get_context('DRUSH_AFFIRMATIVE'); + drush_set_context('DRUSH_AFFIRMATIVE', FALSE); + // Invoke a new process to download dependencies. + $result = drush_invoke_process('@self', 'pm-download', $download, array(), array('interactive' => TRUE)); + // Restore DRUSH_AFFIRMATIVE context. + drush_set_context('DRUSH_AFFIRMATIVE', $drush_affirmative); + // Refresh module cache after downloading the new modules. + $extension_info = drush_get_extensions(); + $recheck = TRUE; + } } if (!empty($modules)) { @@ -1193,6 +1222,7 @@ function drush_pm_update() { // Call pm-updatecode. updatedb will be called in the post-update process. $args = pm_parse_arguments(func_get_args(), FALSE); + drush_set_option('check-updatedb', FALSE); return drush_invoke('pm-updatecode', $args); } @@ -1226,9 +1256,8 @@ function drush_pm_post_pm_updatecode() { // Skip if updatecode was invoked by pm-update. // This way we avoid being noisy, as updatedb is to be executed. - $command = drush_get_command(); - if ($command['command'] != 'pm-update') { - if (drush_get_context('DRUSH_PM_UPDATED', FALSE) !== FALSE) { + if (drush_get_option('check-updatedb', TRUE)) { + if (drush_get_context('DRUSH_PM_UPDATED', FALSE)) { drush_invoke_process('@self', 'pm-updatecode-postupdate'); } } diff -Nru drush-5.9/commands/pm/release_info/updatexml.inc drush-5.10.0/commands/pm/release_info/updatexml.inc --- drush-5.9/commands/pm/release_info/updatexml.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/pm/release_info/updatexml.inc 2013-09-26 16:05:05.000000000 +0000 @@ -101,18 +101,20 @@ /** * Check if a project is available in a update service. * - * It also checks for consistency by comparing given project type and the - * type obtained from the update service. + * Optionally check for consistency by comparing given project type and + * the type obtained from the update service. */ -function release_info_check_project($request, $type) { +function release_info_check_project($request, $type = NULL) { $xml = updatexml_get_release_history_xml($request); if (!$xml) { return FALSE; } - $project_type = updatexml_determine_project_type($xml); - if ($project_type != $type) { - return FALSE; + if ($type) { + $project_type = updatexml_determine_project_type($xml); + if ($project_type != $type) { + return FALSE; + } } return TRUE; diff -Nru drush-5.9/commands/runserver/runserver.drush.inc drush-5.10.0/commands/runserver/runserver.drush.inc --- drush-5.9/commands/runserver/runserver.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/runserver/runserver.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -34,7 +34,7 @@ case 'drush:runserver': return dt("Runs a lightweight built in http server for development. - Don't use this for production, it is neither scalable nor secure for this use. - - If you run multiple servers simultaniously, you will need to assign each a unique port. + - If you run multiple servers simultaneously, you will need to assign each a unique port. - Use Ctrl-C or equivalent to stop the server when complete."); } } diff -Nru drush-5.9/commands/sql/sql.drush.inc drush-5.10.0/commands/sql/sql.drush.inc --- drush-5.9/commands/sql/sql.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/sql/sql.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -24,9 +24,13 @@ 'description' => 'The DB connection key if using multiple connections in settings.php.', 'example-value' => 'extra', ); - if (drush_drupal_major_version() >= 7) { - $options['target'] = 'The name of a target within the specified database.'; - } + $options['target'] = array( + 'description' => 'The name of a target within the specified database.', + 'example-value' => 'key', + // Gets unhidden in help_alter(). We only want to show this to D7 users but have to + // declare it here since some commands do not bootstrap fully. + 'hidden' => TRUE, + ); $db_url['db-url'] = array( 'description' => 'A Drupal 6 style database URL. Only required for initial install - not re-install.', 'example-value' => 'mysql://root:pass@127.0.0.1/db', @@ -49,7 +53,7 @@ $items['sql-conf'] = array( 'description' => 'Print database connection details using print_r().', 'hidden' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, + 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, 'options' => array( 'all' => 'Show all database connections, instead of just one.', 'show-passwords' => 'Show database password.', @@ -153,13 +157,25 @@ 'source-remote-host' => 'Remote machine to run sql-dump file on. Optional; default is local machine.', 'source-dump' => 'Path to dump file. Optional; default is to create a temporary file.', 'source-database' => 'A key in the $db_url (D6) or $databases (D7+) array which provides the data.', - 'source-target' => 'Oy. A key within the --target_database identifying a particular server in the database group.', + 'source-target' => array( + 'description' => 'A key within the SOURCE database identifying a particular server in the database group.', + 'example-value' => 'key', + // Gets unhidden in help_alter(). We only want to show to D7 users but have to + // declare it here since this command does not bootstrap fully. + 'hidden' => TRUE, + ), 'target-db-url' => '', 'target-remote-port' => '', 'target-remote-host' => '', 'target-dump' => '', 'target-database' => 'A key in the $db_url (D6) or $databases (D7+) array which shall receive the data.', - 'target-target' => 'Oy. A key within the --target_database identifying a particular server in the database group.', + 'target-target' => array( + 'description' => 'Oy. A key within the TARGET database identifying a particular server in the database group.', + 'example-value' => 'key', + // Gets unhidden in help_alter(). We only want to show to D7 users but have to + // declare it here since this command does not bootstrap fully. + 'hidden' => TRUE, + ), 'temp' => 'Use a temporary file to hold dump files. Implies --no-cache.', 'dump-dir' => 'Directory to store sql dump files in when --source-dump or --target-dump are not used. Takes precedence over --temp.', 'create-db' => 'Create a new database before importing the database dump on the target machine.', @@ -183,18 +199,17 @@ ), 'topics' => array('docs-aliases', 'docs-policy', 'docs-example-sync-via-http', 'docs-example-sync-extension'), ); - if (drush_drupal_major_version() >= 7) { - - $items['sql-sync']['options'] += array( - 'source-target' => 'The name of a target within the SOURCE database.', - 'destination-target' => 'The name of a target within the specified DESTINATION database.', - ); - } $items['sql-cli'] = array( 'description' => "Open a SQL command-line interface using Drupal's credentials.", 'bootstrap' => DRUSH_BOOTSTRAP_DRUSH, - 'options' => $options + $db_url, + 'options' => array( + 'A' => 'Skip reading table information. This gives a quicker start of mysql.', + ) + $db_url, 'aliases' => array('sqlc'), + 'examples' => array( + 'drush sql-cli' => "Open a SQL command-line interface using Drupal's credentials.", + 'drush sql-cli -A' => "Open a SQL command-line interface using Drupal's credentials and skip reading table information.", + ), ); $items['sql-sanitize'] = array( 'description' => "Run sanitization operations on the current database.", @@ -210,6 +225,21 @@ } /** + * Implements hook_drush_help_alter(). + */ +function sql_drush_help_alter(&$command) { + // Drupal 7+ only options. + if (drush_drupal_major_version() >= 7) { + if ($command['command'] == 'sql-sync') { + unset($command['options']['source-target']['hidden'], $command['options']['target-target']['hidden']); + } + else { + unset($command['options']['target']['hidden']); + } + } +} + +/** * Command argument complete callback. * * @return @@ -232,6 +262,15 @@ * Command callback. Displays the Drupal site's database connection string. */ function drush_sql_conf() { + // Under Drupal 7, if the database is configured but empty, then + // DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION will throw an exception. + // If this happens, we'll just catch it and continue. + // TODO: Fix this in the bootstrap, per http://drupal.org/node/1996004 + try { + drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION); + } + catch (Exception $e) { + } if (drush_get_option('db-url', FALSE)) { $db_spec['db-url'] = $GLOBALS['db_url']; } @@ -256,6 +295,9 @@ switch (_drush_sql_get_scheme($db_spec)) { case 'mysql': $command = 'mysql'; + if (drush_get_option('A', FALSE)) { + $command .= ' -A'; + } break; case 'pgsql': $command = 'psql'; @@ -595,7 +637,11 @@ if (drush_get_option('db-prefix')) { drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_DATABASE); } - return _drush_sql_query($query, NULL, $filename); + $result = _drush_sql_query($query, NULL, $filename); + if (!$result) { + return drush_set_error('DRUSH_SQL_NO_QUERY', dt('Query failed.')); + } + return TRUE; } /* @@ -666,11 +712,15 @@ } function drush_sql_drop() { - if (!drush_confirm(dt('Do you really want to drop all tables?'))) { + drush_sql_bootstrap_further(); + $db_spec = _drush_sql_get_db_spec(); + if (!$db_spec) { + return drush_set_error('DRUSH_SQL_NO_DATABASE', dt("No database to operate on.")); + } + if (!drush_confirm(dt('Do you really want to drop all tables in the database !db?', array('!db' => $db_spec['database'])))) { return drush_user_abort(); } - drush_sql_bootstrap_further(); - _drush_sql_drop(); + _drush_sql_drop($db_spec); } // n.b. site-install uses _drush_sql_drop as a fallback technique if diff -Nru drush-5.9/commands/user/user.drush.inc drush-5.10.0/commands/user/user.drush.inc --- drush-5.9/commands/user/user.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/commands/user/user.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -133,9 +133,6 @@ 'arguments' => array( 'name' => 'The name of the account to cancel', ), - 'options' => array( - 'delete-content' => 'Instead of re-assigning content from the cancelled user to user ID 1, delete it.', - ), 'required-arguments' => TRUE, 'examples' => array( 'drush user-cancel username' => @@ -181,16 +178,19 @@ 'drush user-login --browser=firefox --mail=drush@example.org admin/settings/performance' => 'Open firefox web browser, login as the user with the e-mail address drush@example.org and redirect to the path admin/settings/performance.', ), ); + return $items; +} - // Drupal 7 only options. - if (drush_drupal_major_version() >= 7) { - $items['user-cancel']['options'] = array( - 'delete-content' => 'Delete all content created by the user', - ); - $items['user-cancel']['examples']['drush user-cancel --delete-content username'] = +/** + * Implements hook_drush_help_alter(). + */ +function user_drush_help_alter(&$command) { + // Drupal 7+ only options. + if ($command['command'] == 'user-cancel' && drush_drupal_major_version() >= 7) { + $command['options']['delete-content'] = 'Delete all content created by the user'; + $command['examples']['drush user-cancel --delete-content username'] = 'Cancel the user account with the name username and delete all content created by that user.'; } - return $items; } /** diff -Nru drush-5.9/debian/changelog drush-5.10.0/debian/changelog --- drush-5.9/debian/changelog 2013-06-14 19:47:34.000000000 +0000 +++ drush-5.10.0/debian/changelog 2013-10-17 21:20:21.000000000 +0000 @@ -1,3 +1,18 @@ +drush (5.10.0-2) unstable; urgency=low + + * properly replace drush-make, eases upgrades from 4.x + + -- Antoine Beaupré Thu, 17 Oct 2013 17:20:08 -0400 + +drush (5.10.0-1) unstable; urgency=low + + * New upstream release. + * Change URLs and watch file as upstream swited to github. + * Update to policy 3.9.4, no change. + * Fix drupal dependency (Closes: #712822) + + -- Antoine Beaupré Thu, 10 Oct 2013 15:17:39 +0200 + drush (5.9-1) unstable; urgency=low * New upstream release. diff -Nru drush-5.9/debian/control drush-5.10.0/debian/control --- drush-5.9/debian/control 2013-06-14 19:47:34.000000000 +0000 +++ drush-5.10.0/debian/control 2013-10-17 21:20:21.000000000 +0000 @@ -3,16 +3,18 @@ Priority: optional Maintainer: Antoine Beaupré Build-Depends: debhelper (>= 7.0.50~), php5-cli (>= 5.2) -Standards-Version: 3.9.3 -Homepage: http://drupal.org/project/drush +Standards-Version: 3.9.4 +Homepage: https://github.com/drush-ops/drush Vcs-git: git://git.debian.org/git/collab-maint/drush.git Vcs-browser: http://git.debian.org/git/collab-maint/drush.git Package: drush Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, php5-cli (>= 5.2), php-console-table +Conflicts: drush-make +Replaces: drush-make Recommends: wget | curl, php5-mysql | php5-pgsql -Suggests: git, mysql-client, drupal +Suggests: git, mysql-client, drupal7 Description: command line shell and Unix scripting interface for Drupal drush is a command line shell and Unix scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for diff -Nru drush-5.9/debian/drush.docs drush-5.10.0/debian/drush.docs --- drush-5.9/debian/drush.docs 2013-06-14 19:47:34.000000000 +0000 +++ drush-5.10.0/debian/drush.docs 2013-10-17 21:20:21.000000000 +0000 @@ -1,2 +1,2 @@ -README.txt +README.md docs/ diff -Nru drush-5.9/debian/watch drush-5.10.0/debian/watch --- drush-5.9/debian/watch 2013-06-14 19:47:34.000000000 +0000 +++ drush-5.10.0/debian/watch 2013-10-17 21:20:21.000000000 +0000 @@ -3,4 +3,4 @@ # Compulsory line, this is a version 3 file version=3 -https://drupal.org/project/drush/ http://ftp.drupal.org/files/projects/drush-7.x-(\d\.\d)\.tar\.gz +opts=uversionmangle=s/(\d)[\.\+\-_]?(beta|Beta|alpha|dev)/$1~$2/ https://github.com/drush-ops/drush/tags .*/archive/(\d\S*)\.tar\.gz diff -Nru drush-5.9/docs/make.txt drush-5.10.0/docs/make.txt --- drush-5.9/docs/make.txt 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/docs/make.txt 2013-09-26 16:05:05.000000000 +0000 @@ -381,7 +381,7 @@ ), 'options' => array('any' => TRUE, 'other' => TRUE, 'options' => TRUE), ), -5. Test! Run drush test suite (see DRUSH/tests/README.txt). To just +5. Test! Run drush test suite (see DRUSH/tests/README.md). To just run the make tests: `phpunit --filter=makeMake .` diff -Nru drush-5.9/drush drush-5.10.0/drush --- drush-5.9/drush 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/drush 2013-09-26 16:05:05.000000000 +0000 @@ -12,12 +12,14 @@ SELF_PATH="`cd -P -- "$SELF_DIRNAME" && pwd -P`/`basename -- "$0"`" # Decide if we are running a Unix shell on Windows -case "`uname -a`" in - CYGWIN*) - CYGWIN=1 ;; - MINGW*) - MINGW=1 ;; -esac +if [ `which uname` ]; then + case "`uname -a`" in + CYGWIN*) + CYGWIN=1 ;; + MINGW*) + MINGW=1 ;; + esac +fi # Resolve symlinks - this is the equivalent of "readlink -f", but also works with non-standard OS X readlink. while [ -h "$SELF_PATH" ]; do @@ -76,13 +78,13 @@ # Check to see if the user has provided a php.ini file or drush.ini file in any conf dir # Last found wins, so search in reverse priority order -for conf_dir in "`dirname "$SELF_PATH"`" /etc/drush $HOME/.drush ; do - if [ ! -d $conf_dir ] ; then +for conf_dir in "`dirname "$SELF_PATH"`" /etc/drush "$HOME/.drush" ; do + if [ ! -d "$conf_dir" ] ; then continue fi # Handle paths that don't start with a drive letter on MinGW shell. Equivalent to cygpath on Cygwin. if [ -n "$MINGW" ] ; then - conf_dir=`sh -c "cd $conf_dir; pwd -W"` + conf_dir=`sh -c "cd "$conf_dir"; pwd -W"` fi if [ -f "$conf_dir/php.ini" ] ; then drush_php_ini="$conf_dir/php.ini" @@ -118,11 +120,11 @@ php_options="$php_options $PHP_OPTIONS" fi -# Pass in the path to php so that drush knows which one -# to use if it re-launches itself to run subcommands. We -# will also pass php options if any are defined. -if [ -z "$php_options" ] ; then - exec "$php" $php_options "$SCRIPT_PATH" --php="$php" "$@" -else - exec "$php" $php_options "$SCRIPT_PATH" --php="$php" --php-options="$php_options" "$@" -fi +# Always disable magic_quotes_gpc and friends +php_options="$php_options -d magic_quotes_gpc=Off -d magic_quotes_runtime=Off -d magic_quotes_sybase=Off" + +# Pass in the path to php so that drush knows which one to use if it +# re-launches itself to run subcommands. We will also pass in the php options. +# Important note: Any options added here must be removed when Drush processes +# a #! (shebang) script. @see drush_adjust_args_if_shebang_script() +exec "$php" $php_options "$SCRIPT_PATH" --php="$php" --php-options="$php_options" "$@" diff -Nru drush-5.9/drush.info drush-5.10.0/drush.info --- drush-5.9/drush.info 2013-04-17 20:45:12.000000000 +0000 +++ drush-5.10.0/drush.info 2013-09-26 16:05:05.000000000 +0000 @@ -1,8 +1 @@ -drush_version=5.9 - -; Information added by drupal.org packaging script on 2013-04-17 -version = "7.x-5.9" -core = "7.x" -project = "drush" -datestamp = "1366231512" - +drush_version=5.10.0 diff -Nru drush-5.9/examples/example.drushrc.php drush-5.10.0/examples/example.drushrc.php --- drush-5.9/examples/example.drushrc.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/examples/example.drushrc.php 2013-09-26 16:05:05.000000000 +0000 @@ -63,7 +63,7 @@ */ // Specify a particular multisite. -# $options['l'] = 'http://example.com/subir'; +# $options['l'] = 'http://example.com/subdir'; // Specify your Drupal core base directory (useful if you use symlinks). # $options['r'] = '/home/USER/workspace/drupal-6'; diff -Nru drush-5.9/examples/example.make drush-5.10.0/examples/example.make --- drush-5.9/examples/example.make 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/examples/example.make 2013-09-26 16:05:05.000000000 +0000 @@ -64,7 +64,7 @@ projects[ctools][version] = 1.3 ; Check out the latest version of a project from Git. Note that when using a -; repository as your project source, you must explictly declare the project +; repository as your project source, you must explicitly declare the project ; type so that drush_make knows where to put your project. projects[data][type] = module diff -Nru drush-5.9/includes/backend.inc drush-5.10.0/includes/backend.inc --- drush-5.9/includes/backend.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/backend.inc 2013-09-26 16:05:05.000000000 +0000 @@ -74,7 +74,7 @@ * invoke call (currently only used for log and error messages). */ define('DRUSH_BACKEND_PACKET_START', "DRUSH_BACKEND:"); -define('DRUSH_BACKEND_PACKET_PATTERN', "\0" . DRUSH_BACKEND_PACKET_START . "%s\0\n"); +define('DRUSH_BACKEND_PACKET_PATTERN', "\0" . DRUSH_BACKEND_PACKET_START . "%s\n\0"); /** * The backend result is the original PHP data structure (usually an array) @@ -214,7 +214,9 @@ if (drush_get_context('DRUSH_BACKEND')) { $data['packet'] = $packet; $data = json_encode($data); - drush_print(sprintf(DRUSH_BACKEND_PACKET_PATTERN, $data), 0, STDERR); + // We use 'fwrite' instead of 'drush_print' here because + // this backend packet is out-of-band data. + fwrite(STDERR, sprintf(DRUSH_BACKEND_PACKET_PATTERN, $data)); return TRUE; } @@ -431,10 +433,17 @@ $bucket[$site]['remainder'] = ''; $output_end_pos = strpos($string, DRUSH_BACKEND_OUTPUT_START); if ($output_end_pos !== FALSE) { - $trailing_string = trim(substr($string, 0, $output_end_pos)); - if (!empty($trailing_string)) { - $trailing_remainder = ''; + $trailing_string = substr($string, 0, $output_end_pos); + $trailing_remainder = ''; + // If there is any data in the trailing string (characters prior + // to the backend output start), then process any backend packets + // embedded inside. + if (strlen($trailing_string) > 0) { drush_backend_parse_packets($trailing_string, $trailing_remainder, $bucket[$site]['backend-options']); + } + // If there is any data remaining in the trailing string after + // the backend packets are removed, then print it. + if (strlen($trailing_string) > 0) { _drush_backend_print_output($trailing_string . $trailing_remainder, $bucket[$site]['backend-options']); $bucket[$site]['outputted'] = TRUE; } @@ -444,7 +453,7 @@ drush_backend_parse_packets($string, $bucket[$site]['remainder'], $bucket[$site]['backend-options']); // Pass output through. _drush_backend_print_output($string, $bucket[$site]['backend-options']); - if (!empty($string)) { + if (strlen($string) > 0) { $bucket[$site]['outputted'] = TRUE; } } @@ -455,7 +464,7 @@ // Reset the $nap_time variable as there might be output to process // next time around: - if (!empty($string)) { + if (strlen($string) > 0) { $nap_time = 0; } } @@ -541,7 +550,7 @@ } } - $string = trim(preg_replace("/$packet_regex/s", '', $string)); + $string = preg_replace("/$packet_regex/s", '', $string); } // Check to see if there is potentially a partial packet remaining. // We only care about the last null; if there are any nulls prior @@ -870,6 +879,11 @@ // in the global option list) from the commandline options and put them into the post options. // The post options will be json-encoded and sent to the command via stdin $global_option_list = drush_get_global_options(FALSE); // These should be in the command line. + $additional_global_options = array(); + if (array_key_exists('additional-global-options', $backend_options)) { + $additional_global_options = $backend_options['additional-global-options']; + $command_options += $additional_global_options; + } $method_post = ((!array_key_exists('method', $backend_options)) || ($backend_options['method'] == 'POST')); $post_options = array(); $commandline_options = array(); @@ -921,7 +935,7 @@ } // In METHOD GET, ignore options with array values elseif (!is_array($value)) { - if ($global) { + if ($global || array_key_exists($key, $additional_global_options)) { $drush_global_options[$key] = $value; } else { @@ -980,7 +994,7 @@ return $ret; } else { - $process_limit = drush_get_option_override($common_backend_options, 'concurrency', 4); + $process_limit = drush_get_option_override($common_backend_options, 'concurrency', 1); $procs = _drush_backend_proc_open($cmds, $process_limit, $context); $procs = is_array($procs) ? $procs : array($procs); @@ -1132,12 +1146,6 @@ $command = implode(' ', array_filter($ssh_cmd, 'strlen')); } } - else { - // TODO: `tty` is not usable on Windows. Is this necessary at all, and if so, is there a better way to do it? - if (!drush_is_windows() && !empty($backend_options['interactive'])) { - $command .= ' > `tty`'; - } - } return $command; } diff -Nru drush-5.9/includes/bootstrap.inc drush-5.10.0/includes/bootstrap.inc --- drush-5.9/includes/bootstrap.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/bootstrap.inc 2013-09-26 16:05:05.000000000 +0000 @@ -601,7 +601,7 @@ if (getenv('SHARE_PREFIX')) drush_set_context('SHARE_PREFIX', getenv('SHARE_PREFIX')); drush_set_context('DOC_PREFIX', DRUSH_BASE_PATH); - if (!file_exists(DRUSH_BASE_PATH . '/README.txt') && file_exists(drush_get_context('SHARE_PREFIX', '/usr') . '/share/doc/drush') . '/README.txt') { + if (!file_exists(DRUSH_BASE_PATH . '/README.md') && file_exists(drush_get_context('SHARE_PREFIX', '/usr') . '/share/doc/drush' . '/README.md')) { drush_set_context('DOC_PREFIX', drush_get_context('SHARE_PREFIX', '/usr') . '/share/doc/drush'); } $alias_path =& drush_get_context('ALIAS_PATH'); @@ -757,6 +757,10 @@ ); $_SERVER['HTTP_HOST'] = $drupal_base_url['host']; + if ($drupal_base_url['scheme'] == 'https') { + $_SERVER['HTTPS'] = 'on'; + } + if ($drupal_base_url['port']) { $_SERVER['HTTP_HOST'] .= ':' . $drupal_base_url['port']; } diff -Nru drush-5.9/includes/command.inc drush-5.10.0/includes/command.inc --- drush-5.9/includes/command.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/command.inc 2013-09-26 16:05:05.000000000 +0000 @@ -660,8 +660,8 @@ // local php settings should not override sitealias settings unset($cli_context['php']); unset($cli_context['php-options']); - // cli overrides sitealias - $options = $cli_context + drush_get_context('alias'); + // cli overrides sitealias and command specific + $options = $cli_context + drush_get_context('alias') + drush_get_context('specific'); $options = array_diff_key($options, array_flip(drush_sitealias_site_selection_keys())); unset($options['command-specific']); @@ -864,17 +864,23 @@ */ function drush_adjust_args_if_shebang_script(&$args) { if (drush_has_bash()) { - if (_drush_is_drush_shebang_script($args[1])) { + // The drush script may add --php or --php-options at the + // head of the argument list; skip past those. + $base_arg_number = 1; + while (substr($args[$base_arg_number], 0, 5) == '--php') { + ++$base_arg_number; + } + if (_drush_is_drush_shebang_script($args[$base_arg_number])) { // If $args[1] is a drush "shebang" script, we will insert // the option "--bootstrap-to-first-arg" and the command // "php-script" at the beginning of @args, so the command // line args become: // /path/to/drush --bootstrap-to-first-arg php-script /path/to/script userArg1 userArg2 ... drush_set_option('bootstrap-to-first-arg', TRUE); - array_splice($args, 1, 0, array('php-script')); + array_splice($args, $base_arg_number, 0, array('php-script')); drush_set_context('DRUSH_SHEBANG_SCRIPT', TRUE); } - elseif (((strpos($args[1], ' ') !== FALSE) || (!ctype_alnum($args[1][0]))) && (_drush_is_drush_shebang_script($args[2]))) { + elseif (((strpos($args[$base_arg_number], ' ') !== FALSE) || (!ctype_alnum($args[$base_arg_number][0]))) && (_drush_is_drush_shebang_script($args[$base_arg_number + 1]))) { // If $args[2] is a drush "shebang" script, we will insert // the space-exploded $arg[1] in place of $arg[1], so the // command line args become: @@ -882,7 +888,7 @@ // If none of the script arguments look like a drush command, // then we will insert "php-script" as the default command to // execute. - $script_args = explode(' ', $args[1]); + $script_args = explode(' ', $args[$base_arg_number]); $has_command = FALSE; foreach ($script_args as $script_arg) { if (preg_match("/^[a-z][a-z0-9-]*$/",$script_arg)) { @@ -892,7 +898,7 @@ if (!$has_command) { $script_args[] = 'php-script'; } - array_splice($args, 1, 1, $script_args); + array_splice($args, 1, $base_arg_number, $script_args); drush_set_context('DRUSH_SHEBANG_SCRIPT', TRUE); } } @@ -1510,7 +1516,7 @@ */ function drush_command_default_options($command = NULL) { $command_default_options = drush_get_context('command-specific'); - return drush_command_set_command_specific($command_default_options); + return drush_command_set_command_specific($command_default_options, $command); } function drush_sitealias_command_default_options($site_record, $prefix, $command = NULL) { @@ -1776,7 +1782,12 @@ $unmatched_replacements = preg_replace('/[{}]/', '', $unmatched_replacements); return drush_set_error('DRUSH_SHELL_ALIAS_UNMATCHED_REPLACEMENTS', dt('The shell alias @alias-name uses replacements "@unmatched". You must use this command with a site alias (e.g. `drush @myalias @alias-name ...`) that defines all of these variables.', array('@alias-name' => $first, '@unmatched' => $unmatched_replacements))); } - $alias_value = explode(' ', $alias_value); + if (function_exists('str_getcsv')) { + $alias_value = str_getcsv($alias_value, ' '); + } + else { + $alias_value = explode(' ', $alias_value); + } } drush_log(dt('Shell alias found: !key => !value', array('!key' => $first, '!value' => implode(' ', $alias_value))), 'debug'); $replacement = $alias_value; diff -Nru drush-5.9/includes/complete.inc drush-5.10.0/includes/complete.inc --- drush-5.9/includes/complete.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/complete.inc 2013-09-26 16:05:05.000000000 +0000 @@ -108,10 +108,9 @@ } // Set up as if we were running the command, and attempt to parse. $argv = drush_complete_process_argv(); - $set_sitealias = drush_sitealias_get_record('@self'); - $set_sitealias_name = NULL; - if (!empty($set_sitealias['#name'])) { - $set_sitealias_name = $set_sitealias['#name']; + if ($alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS')) { + $set_sitealias_name = $alias; + $set_sitealias = drush_sitealias_get_record($alias); } // Arguments have now had site-aliases and options removed, so we take the @@ -149,7 +148,7 @@ $completions += drush_hyphenate_options(drush_complete_match($last_word, drush_complete_get('options'))); } else { - if (!$set_sitealias_name) { + if (empty($set_sitealias_name)) { // Include site alias completions. $completions += drush_complete_match($last_word, drush_complete_get('site-aliases')); } @@ -523,7 +522,12 @@ // the possibility of cache misses/ but they should be rare, since sites are // normally referred to the same way (e.g. a site alias, or using the current // directory), at least within a single command completion session. - $root = drush_get_option(array('r', 'root'), drush_locate_root()); - $site = drush_get_option(array('l', 'uri'), drush_site_path()); + // We also static cache them, since we may get differing results after + // bootstrap, which prevents the caches from being found on the next call. + static $root, $site; + if (empty($root)) { + $root = drush_get_option(array('r', 'root'), drush_locate_root()); + $site = drush_get_option(array('l', 'uri'), drush_site_path()); + } return drush_get_cid('complete', array(), array($type, $command, $root, $site)); } diff -Nru drush-5.9/includes/context.inc drush-5.10.0/includes/context.inc --- drush-5.9/includes/context.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/context.inc 2013-09-26 16:05:05.000000000 +0000 @@ -350,12 +350,14 @@ } /** - * Get the arguments passed to the drush.php script. + * Gets the command line arguments passed to Drush. * - * When drush_set_arguments is initially called by drush_parse_args, - * the entire list of arguments will be populated. - * Once the command has been dispatched, this will be return only the remaining - * arguments to the command. + * @return array + * An indexed array of arguments. Until Drush has dispatched the command, the + * array will include the command name as the first element. After that point + * the array will not include the command name. + * + * @see drush_set_arguments() */ function drush_get_arguments() { return drush_get_context('arguments'); diff -Nru drush-5.9/includes/drush.inc drush-5.10.0/includes/drush.inc --- drush-5.9/includes/drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -387,7 +387,7 @@ $options['pipe'] = array('short-form' => 'p', 'description' => "Emit a compact representation of the command for scripting."); $options['help'] = array('short-form' => 'h', 'description' => "This help system."); $options['version'] = array('description' => "Show drush version."); - $options['php'] = array('description' => "The absolute path to your PHP intepreter, if not 'php' in the path.", 'example-value' => '/path/to/file'); + $options['php'] = array('description' => "The absolute path to your PHP intepreter, if not 'php' in the path.", 'example-value' => '/path/to/file', 'never-propagate' => TRUE); $options['interactive'] = array('short-form' => 'ia', 'description' => "Force interactive mode for commands run on multiple targets (e.g. `drush @site1,@site2 cc --ia`)."); if (!$brief) { @@ -413,7 +413,7 @@ $options['backup-location'] = array('description' => "Specifies the directory where drush will store backups."); $options['confirm-rollback'] = array('description' => 'Wait for confirmation before doing a rollback when something goes wrong.'); $options['complete-debug'] = array('hidden' => TRUE, 'description' => "Turn on debug mode forf completion code"); - $options['php-options'] = array('description' => "Options to pass to php when running drush. Only effective when using the `drush` script."); + $options['php-options'] = array('description' => "Options to pass to php when running drush. Only effective when using the `drush` script.", 'never-propagate' => TRUE); $options['deferred-sanitization'] = array('hidden' => TRUE, 'description' => "Defer calculating the sanitization operations until after the database has been copied. This is done automatically if the source database is remote."); $options['remote-host'] = array('hidden' => TRUE, 'description' => 'Remote site to execute drush command on. Managed by site alias.'); $options['remote-user'] = array('hidden' => TRUE, 'description' => 'User account to use with a remote drush command. Managed by site alias.'); @@ -1075,7 +1075,7 @@ // Remove the header line. array_shift($output); // Remove the prefix verb from each line. - $output = array_map(create_function('$str', 'return substr($str, strpos($str, ":") + 3 + ' . strlen(dirname($path)) . ');'), $output); + $output = array_map(create_function('$str', 'return substr($str, strpos($str, ":") + 3 + ' . strlen($destination) . ');'), $output); // Remove any remaining blank lines. $return = array_filter($output, create_function('$str', 'return $str != "";')); } @@ -1253,7 +1253,7 @@ // Force interactive mode if there is a single remote target. #interactive is added by drush_do_command_redispatch drush_set_option('interactive', TRUE); - $values = drush_do_command_redispatch($command_name, $args, $remote_host, $remote_user); + $values = drush_do_command_redispatch(isset($command) ? $command : $command_name, $args, $remote_host, $remote_user); // In 'interactive' mode, $values is the result code from drush_shell_proc_open. // TODO: in _drush_backend_invoke, return array('error_status' => $ret) instead for uniformity. if (!is_array($values) && ($values != 0)) { @@ -1428,8 +1428,24 @@ * options that were passed to this invocation of drush. */ function drush_do_command_redispatch($command, $args = array(), $remote_host = NULL, $remote_user = NULL, $drush_path = NULL) { + $additional_global_options = array(); $command_options = drush_redispatch_get_options(); - + if (is_array($command)) { + $command_name = $command['command']; + // If we are executing a remote command that uses strict option handling, + // then mark all of the options in the alias context as global, so that they + // will appear before the command name. + if (!empty($command['strict-option-handling'])) { + foreach(drush_get_context('alias') as $alias_key => $alias_value) { + if (array_key_exists($alias_key, $command_options) && !array_key_exists($alias_key, $command['options'])) { + $additional_global_options[$alias_key] = $alias_value; + } + } + } + } + else { + $command_name = $command; + } // If the path to drush was supplied, then use it to invoke the new command. if ($drush_path == NULL) { $drush_path = drush_get_option('drush-script'); @@ -1440,14 +1456,14 @@ } } } - $backend_options = array('drush-script' => $drush_path, 'remote-host' => $remote_host, 'remote-user' => $remote_user, 'integrate' => TRUE); + $backend_options = array('drush-script' => $drush_path, 'remote-host' => $remote_host, 'remote-user' => $remote_user, 'integrate' => TRUE, 'additional-global-options' => $additional_global_options); if (drush_get_option('interactive')) { $backend_options['interactive'] = TRUE; } // Run the command in a new process. drush_log(dt('Begin redispatch via invoke process')); - $values = drush_invoke_process('@self', $command, $args, $command_options, $backend_options); + $values = drush_invoke_process('@self', $command_name, $args, $command_options, $backend_options); drush_log(dt('Invoke process is complete')); return $values; diff -Nru drush-5.9/includes/environment.inc drush-5.10.0/includes/environment.inc --- drush-5.9/includes/environment.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/environment.inc 2013-09-26 16:05:05.000000000 +0000 @@ -88,7 +88,7 @@ * notify the user that a setting change is needed and abort. */ function _drush_environment_check_php_ini() { - $ini_checks = array('safe_mode' => '', 'open_basedir' => '', 'disable_functions' => array('exec', 'system'), 'disable_classes' => '', 'magic_quotes_gpc' => '', 'magic_quotes_runtime' => ''); + $ini_checks = array('safe_mode' => '', 'open_basedir' => '', 'disable_functions' => array('exec', 'system'), 'disable_classes' => ''); // Test to insure that certain php ini restrictions have not been enabled $prohibited_list = array(); @@ -96,7 +96,7 @@ $ini_value = ini_get($prohibited_mode); $invalid_value = FALSE; if (empty($disallowed_value)) { - $invalid_value = !empty($ini_value); + $invalid_value = !empty($ini_value) && (strcasecmp($ini_value, 'off') != 0); } else { foreach ($disallowed_value as $test_value) { @@ -648,6 +648,14 @@ } /** + * Check if the operating system is OS X. + * This will return TRUE for Mac OS X (Darwin). + */ +function drush_is_osx($os = NULL) { + return _drush_test_os($os, array("DARWIN")); +} + +/** * Checks if the operating system has bash. * * MinGW has bash, but PHP isn't part of MinGW and hence doesn't run in bash. @@ -832,7 +840,13 @@ drush_include_engine('drupal', 'environment'); $extensions = array_merge(drush_get_modules($include_hidden), drush_get_themes($include_hidden)); foreach ($extensions as $name => $extension) { - $extensions[$name]->label = $extension->info['name'].' ('.$extension->name.')'; + if (isset($extension->info['name'])) { + $extensions[$name]->label = $extension->info['name'].' ('.$extension->name.')'; + } + else { + drush_log(dt("Extension !name provides no human-readable name in .info file.", array('!name' => $name), 'debug')); + $extensions[$name]->label = $name.' ('.$extension->name.')'; + } if (empty($extension->info['package'])) { $extensions[$name]->info['package'] = dt('Other'); } @@ -844,15 +858,15 @@ * Test compatibility of a extension with version of drupal core and php. * * @param $file Extension object as returned by system_rebuild_module_data(). - * @return TRUE if the extension is incompatible. + * @return FALSE if the extension is compatible. */ function drush_extension_check_incompatibility($file) { - if (!isset($file->info['core']) - || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY - || version_compare(phpversion(), $file->info['php']) < 0) { - return TRUE; + if (!isset($file->info['core']) || $file->info['core'] != DRUPAL_CORE_COMPATIBILITY) { + return 'Drupal'; + } + if (version_compare(phpversion(), $file->info['php']) < 0) { + return 'PHP'; } - return FALSE; } diff -Nru drush-5.9/includes/exec.inc drush-5.10.0/includes/exec.inc --- drush-5.9/includes/exec.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/exec.inc 2013-09-26 16:05:05.000000000 +0000 @@ -413,8 +413,8 @@ function drush_start_browser($uri = NULL, $sleep = FALSE) { if ($browser = drush_get_option('browser', TRUE)) { // We can only open a browser if we have a DISPLAY environment variable on - // POSIX or are running Windows. - if (!drush_get_context('DRUSH_SIMULATE') && !getenv('DISPLAY') && !drush_is_windows()) { + // POSIX or are running Windows or OS X. + if (!drush_get_context('DRUSH_SIMULATE') && !getenv('DISPLAY') && !drush_is_windows() && !drush_is_osx()) { drush_log(dt('No graphical display appears to be available, not starting browser.'), 'notice'); return FALSE; } @@ -430,7 +430,7 @@ $hosterror = (gethostbynamel($host) === FALSE); $iperror = (ip2long($host) && gethostbyaddr($host) == $host); if (!drush_get_context('DRUSH_SIMULATE') && ($hosterror || $iperror)) { - drush_log(dt('!host does not appear to be a resolvable hostname or IP, not starting browser.', array('!host' => $host)), 'warning'); + drush_log(dt('!host does not appear to be a resolvable hostname or IP, not starting browser. You may need to use the --uri option in your command or site alias to indicate the correct URL of this site.', array('!host' => $host)), 'warning'); return FALSE; } if ($browser === TRUE) { diff -Nru drush-5.9/includes/sitealias.inc drush-5.10.0/includes/sitealias.inc --- drush-5.9/includes/sitealias.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/includes/sitealias.inc 2013-09-26 16:05:05.000000000 +0000 @@ -650,14 +650,26 @@ return $result; } -// array_merge_recursive is too much; we only want to run -// array_merge on the common top-level keys of the array. -function _sitealias_array_merge($a, $b) { - $result = $a; - - foreach($b as $key => $value) { - if (array_key_exists($key, $result)) { - $result[$key] = array_merge($result[$key], $b[$key]); +/** + * Merges two site aliases. + * + * array_merge_recursive is too much; we only want to run + * array_merge on the common top-level keys of the array. + * + * @param array $site_alias_a + * A site alias array. + * @param array $site_alias_b + * A site alias array. + * @return + * A site alias array where the keys from $site_alias_a are overwritten by the + * keys from $site_alias_b. + */ +function _sitealias_array_merge($site_alias_a, $site_alias_b) { + $result = $site_alias_a; + + foreach($site_alias_b as $key => $value) { + if (is_array($value) && array_key_exists($key, $result)) { + $result[$key] = array_merge($result[$key], $value); } else { $result[$key] = $value; @@ -1785,7 +1797,7 @@ // If the --exclude-other-sites option is specified, then // convert that into --include-paths='%site' and --exclude-sites. - if (drush_get_option_override($additional_options, 'exclude-other-sites', FALSE) && !drush_get_option_override($additional_options, 'exclude-other-sites-processed', FALSE, 'process')) { + if (drush_get_option_override($additional_options, 'exclude-other-sites', FALSE) && !drush_get_context('exclude-other-sites-processed', FALSE)) { $include_path_option = drush_get_option_override($additional_options, 'include-paths', ''); $additional_options['include-paths'] = '%site'; if (!empty($include_path_option)) { @@ -1793,7 +1805,7 @@ $additional_options['include-paths'] .= PATH_SEPARATOR . $include_path_option; } $additional_options['exclude-sites'] = TRUE; - $additional_options['exclude-other-sites-processed'] = TRUE; + drush_set_context('exclude-other-sites-processed', TRUE); } else { unset($additional_options['include-paths']); diff -Nru drush-5.9/tests/README.md drush-5.10.0/tests/README.md --- drush-5.9/tests/README.md 1970-01-01 00:00:00.000000000 +0000 +++ drush-5.10.0/tests/README.md 2013-09-26 16:05:05.000000000 +0000 @@ -0,0 +1,42 @@ +Drush's test suite is based on [PHPUnit](http://www.phpunit.de). In order to maintain +high quality, our tests are run on every push by [Travis](https://travis-ci.org/drush-ops/drush) + +Usage +-------- +1. Install PHPUnit + - Follow the [Composer installation instruction](http://getcomposer.org/download) + - Run composer depending on your installation from the Drush root directory + + ```bash + php composer.phar install --dev + composer install --dev + ``` +1. Review the configuration settings in phpunit.xml.dist. If customization is needed, copy to phpunit.xml and edit away. +1. Run unit tests: + + ```bash + $ cd tests + $ php ../vendor/phpunit/phpunit/phpunit.php . + ``` + +Advanced usage +--------- +- Run only tests matching a regex: `phpunit --filter=testVersionString` +- Skip slow tests (usually those with network usage): `phpunit --exclude-group slow` +- XML results: `phpunit --filter=testVersionString --log-junit results.xml` + +Reuse by Drush Commandfiles +----------- +Drush commandfiles are encouraged to ship with PHPUnit test cases that +extend Drush_UnitTestCase and Drush_CommandTestCase. In order to run +the tests, you have to point to the [drush_testcase.inc](tests/drush_testcase.inc) file +such as `phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc`. +The devel project does exactly this - +http://drupalcode.org/project/devel.git/blob/refs/heads/8.x-1.x:/develDrushTest.php + +Cache +----------- +In order to speed up test runs, Unish (the drush testing class) caches built Drupal sites +and restores them as requested by tests. Once in while, you might need to clear this cache +by deleting the /drush-cache directory. + diff -Nru drush-5.9/tests/README.txt drush-5.10.0/tests/README.txt --- drush-5.9/tests/README.txt 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,54 +0,0 @@ -Drush's test suite based on PHPUnit (http://www.phpunit.de/). - -Usage --------- -- Install PHPUnit [*] -- Review the configuration settings in phpunit.xml.dist. If customization is needed, copy and rename to phpunit.xml and edit away. -- From the /tests subdirectory, run `phpunit .` - -Advanced usage ---------- -- Run only tests matching a regex: phpunit --filter=testVersionString . -- Skip slow tests (usually those with network usage): phpunit --exclude-group slow . -- XML results: phpunit --filter=testVersionString --log-junit results.xml . - -Reuse by Drush Commandfiles ------------ -Drush commandfiles are encouraged to ship with PHPUnit test cases that -extend Drush_UnitTestCase and Drush_CommandTestCase. In order to run -the tests, you have to point to the /tests/drush_testcase.inc file -such as `phpunit --bootstrap=/path/to/drush/tests/drush_testcase.inc`. -The devel project does exactly this - -http://drupalcode.org/project/devel.git/blob/refs/heads/8.x-1.x:/develDrushTest.php - -Cache ------------ -In order to speed up test runs, Unish (the drush testing class) caches built Drupal sites -and restores them as requested by tests. Once in while, you might need to clear this cache -by deleting the /drush-cache directory. - -[*] Install PHPUnit: ---------------- - -Drush requires PHPUnit 3.5 or later; installing with PEAR is easiest. - -On Linux/OSX: ---------- - - sudo apt-get install php5-curl php-pear - sudo pear upgrade --force PEAR - sudo pear channel-discover pear.phpunit.de - sudo pear channel-discover components.ez.no - sudo pear channel-discover pear.symfony-project.com - sudo pear install --alldeps phpunit/PHPUnit - -On Windows: ------------ - -Download and save from go-pear.phar http://pear.php.net/go-pear.phar - - php -q go-pear.phar - pear channel-discover pear.phpunit.de - pear channel-discover components.ez.no - pear channel-discover pear.symfony-project.com - pear install --alldeps phpunit/PHPUnit diff -Nru drush-5.9/tests/backendTest.php drush-5.10.0/tests/backendTest.php --- drush-5.9/tests/backendTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/backendTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -202,14 +202,14 @@ $this->drush('php-eval', array($php), $options); $parsed = parse_backend_output($this->getOutput()); // assert that $parsed has 'x' and 'data' - $this->assertEquals(array_diff(array ( + $this->assertEquals(array ( 'x' => 'y', 'data' => array ( 'a' => 1, 'b' => 2, ), -), $parsed['object']), array()); +), $parsed['object']); } /** @@ -226,13 +226,27 @@ 'backend' => NULL, 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. ); - $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET', '#process-read-size' => 16)); return array_key_exists('object', \$values) ? \$values['object'] : 'no result';"; - $this->drush('php-eval', array($php), $options); - $parsed = parse_backend_output($this->getOutput()); - // assert that $parsed has 'x' but not 'data' - $this->assertEquals("array ( - 'x' => 'y', + $read_sizes_to_test = array(4096, 128, 16); + foreach ($read_sizes_to_test as $read_size) { + $log_message=""; + for ($i = 1; $i <= 16; $i++) { + $log_message .= "X"; + $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('log-message' => '$log_message', 'x' => 'y$read_size', 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET', '#process-read-size' => $read_size)); return array_key_exists('object', \$values) ? \$values['object'] : 'no result';"; + $this->drush('php-eval', array($php), $options); + $parsed = parse_backend_output($this->getOutput()); + // assert that $parsed has 'x' but not 'data' + $all_warnings=array(); + foreach ($parsed['log'] as $log) { + if ($log['type'] == 'warning') { + $all_warnings[] = $log['message']; + } + } + $this->assertEquals("$log_message,done", implode(',', $all_warnings), 'Log reconstruction with read_size ' . $read_size); + $this->assertEquals("array ( + 'x' => 'y$read_size', )", var_export($parsed['object'], TRUE)); + } + } } } diff -Nru drush-5.9/tests/drush_testcase.inc drush-5.10.0/tests/drush_testcase.inc --- drush-5.9/tests/drush_testcase.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/drush_testcase.inc 2013-09-26 16:05:05.000000000 +0000 @@ -316,29 +316,19 @@ * @return integer * Exit code. Usually self::EXIT_ERROR or self::EXIT_SUCCESS. */ - function execute($command, $expected_return = self::EXIT_SUCCESS, $env = NULL) { + function execute($command, $expected_return = self::EXIT_SUCCESS, $env = array()) { $this->_output = FALSE; $return = 1; $this->log("Executing: $command", 'notice'); - // If the test passed in an environment to use, then run the test - // with proc_open - if (isset($env)) { - $descriptorspec = array( - 0 => array("pipe", "r"), - 1 => array("pipe", "w") ); - $process = proc_open($command, $descriptorspec, $pipes, NULL, $env); - if (is_resource($process)) { - fclose($pipes[0]); - $output = stream_get_contents($pipes[1]); - $this->_output = explode("\n", rtrim($output)); // one more /n than with exec - fclose($pipes[1]); - $return = proc_close($process); - } - } - // Tests that do not provide their own environment run with exec - else { - exec($command, $this->_output, $return); + + // Apply the environment variables we need for our test + // to the head of the command + $prefix = ''; + foreach ($env as $env_name => $env_value) { + $prefix .= $env_name . '=' . self::escapeshellarg($env_value) . ' '; } + exec($prefix . $command, $this->_output, $return); + $this->assertEquals($expected_return, $return, 'Unexpected exit code: ' . $command); return $return; } @@ -363,7 +353,7 @@ * @return integer * An exit code. */ - function drush($command, array $args = array(), array $options = array(), $site_specification = NULL, $cd = NULL, $expected_return = self::EXIT_SUCCESS, $suffix = NULL, $env = NULL) { + function drush($command, array $args = array(), array $options = array(), $site_specification = NULL, $cd = NULL, $expected_return = self::EXIT_SUCCESS, $suffix = NULL, $env = array()) { $global_option_list = array('simulate', 'root', 'uri', 'include', 'config', 'alias-path', 'ssh-options'); // insert "cd ... ; drush" $cmd[] = $cd ? sprintf('cd %s &&', self::escapeshellarg($cd)) : NULL; diff -Nru drush-5.9/tests/filesystemTest.php drush-5.10.0/tests/filesystemTest.php --- drush-5.9/tests/filesystemTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/filesystemTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -36,7 +36,7 @@ $dest = UNISH_SANDBOX . '/test-filesystem-execute'; mkdir($dest); - $this->drush('pm-download', array('drush'), array('cache' => NULL, 'skip' => NULL, 'destination' => $dest)); + $this->execute(sprintf("git clone https://github.com/drush-ops/drush.git %s", $dest . '/drush')); $perms = fileperms($dest . '/drush/drush') & 0111; $this->assertEquals($perms, 0111, 'Execute permission is preserved.'); diff -Nru drush-5.9/tests/makeTest.php drush-5.10.0/tests/makeTest.php --- drush-5.9/tests/makeTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/makeTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -349,6 +349,13 @@ $this->assertFileExists(UNISH_SANDBOX . '/sites/all/modules/contrib/cck_signup/README.txt'); } + /** + * Test that a distribution can be used as a "core" project. + */ + function testMakeUseDistributionAsCore() { + $this->runMakefileTest('use-distribution-as-core'); + } + function getMakefile($key) { static $tests = array( 'get' => array( @@ -444,7 +451,7 @@ 'name' => 'File extraction', 'makefile' => 'file.make', 'build' => TRUE, - 'md5' => 'c7cab3930f644961a576d78769498172', + 'md5' => '4e9883d6f9f6572af287635689c2545d', 'options' => array('no-core' => NULL), ), 'defaults' => array( @@ -540,6 +547,13 @@ 'md5' => '7c10e6fc65728a77a2b0aed4ec2a29cd', 'options' => array('no-core' => NULL, 'libraries' => 'drush_make,token'), ), + 'use-distribution-as-core' => array( + 'name' => 'Use distribution as core', + 'makefile' => 'use-distribution-as-core.make', + 'build' => TRUE, + 'md5' => '643a603025a20d498eb583a1e7970bad', + 'options' => array(), + ), ); return $tests[$key]; } diff -Nru drush-5.9/tests/makefiles/file.make drush-5.10.0/tests/makefiles/file.make --- drush-5.9/tests/makefiles/file.make 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/makefiles/file.make 2013-09-26 16:05:05.000000000 +0000 @@ -6,6 +6,6 @@ libraries[drush_make][download][filename] = "README.txt" ; Single file download -libraries[jquery.cycle][download][type] = "get" -libraries[jquery.cycle][download][url] = "https://github.com/downloads/malsup/cycle/jquery.cycle.all.2.88.min.js" -libraries[jquery.cycle][download][filename] = "jquery.cycle.js" +libraries[responsiveslides][download][type] = "get" +libraries[responsiveslides][download][url] = "https://raw.github.com/viljamis/ResponsiveSlides.js/v1.54/responsiveslides.min.js" +libraries[responsiveslides][download][filename] = "responsiveslides.js" diff -Nru drush-5.9/tests/makefiles/use-distribution-as-core.make drush-5.10.0/tests/makefiles/use-distribution-as-core.make --- drush-5.9/tests/makefiles/use-distribution-as-core.make 1970-01-01 00:00:00.000000000 +0000 +++ drush-5.10.0/tests/makefiles/use-distribution-as-core.make 2013-09-26 16:05:05.000000000 +0000 @@ -0,0 +1,7 @@ +api = 2 +core = 7.x + +projects[commerce_kickstart][type] = core +projects[commerce_kickstart][version] = "7.x-1.19" +projects[oauth2_server][type] = module +projects[oauth2_server][version] = "1.0-beta2" diff -Nru drush-5.9/tests/pmEnDisUnListTest.php drush-5.10.0/tests/pmEnDisUnListTest.php --- drush-5.9/tests/pmEnDisUnListTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/pmEnDisUnListTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -33,7 +33,7 @@ $this->assertTrue(in_array('devel', $list)); $this->assertTrue(in_array('bartik', $list), 'Themes are in the pm-list'); - $this->drush('sql-query', array("SELECT path FROM menu_router WHERE path = 'devel/settings'"), array('root' => $this->webroot(), 'uri' => key($sites))); + $this->drush('sql-query', array("SELECT path FROM menu_router WHERE path = 'devel/settings';"), array('root' => $this->webroot(), 'uri' => key($sites))); $list = $this->getOutputAsList(); $this->assertTrue(in_array('devel/settings', $list), 'Cache was cleared after modules were enabled'); @@ -64,5 +64,11 @@ $this->drush('pm-list', array(), $options + array('status' => 'enabled')); $list = $this->getOutputAsList(); $this->assertTrue(in_array('token', $list)); + + // Test that pm-enable downloads missing projects and dependencies. + $this->drush('pm-enable', array('views'), $options + array('resolve-dependencies' => TRUE)); + $this->drush('pm-list', array(), $options + array('status' => 'enabled')); + $list = $this->getOutputAsList(); + $this->assertTrue(in_array('ctools', $list)); } } diff -Nru drush-5.9/tests/shellAliasTest.php drush-5.10.0/tests/shellAliasTest.php --- drush-5.9/tests/shellAliasTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/shellAliasTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -86,7 +86,7 @@ $this->drush('glopts', array(), $options, 'user@server/path/to/drupal#sitename'); // $expected might be different on non unix platforms. We shall see. // n.b. --config is not included in calls to remote systems. - $bash = $this->escapeshellarg('drush --invoke --simulate --nocolor --uri=sitename --root=/path/to/drupal topic core-global-options 2>&1'); + $bash = $this->escapeshellarg('drush --invoke --simulate --nocolor --uri=sitename --root=/path/to/drupal core-topic core-global-options 2>&1'); $expected = "Simulating backend invoke: ssh user@server $bash 2>&1"; $output = $this->getOutput(); $this->assertEquals($expected, $output, 'Expected remote shell alias to a drush command was built'); diff -Nru drush-5.9/tests/siteAliasTest.php drush-5.10.0/tests/siteAliasTest.php --- drush-5.9/tests/siteAliasTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/siteAliasTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -7,6 +7,54 @@ * @group base */ class saCase extends Drush_CommandTestCase { + /* + * Covers the following responsibilities. + * - Dispatching a Drush command that uses strict option handling + * using a site alias that contains a generic option (e.g. 'site' + * or 'env') that is not a recognized Drush option (maybe for + * use in an init hook, etc.) places the generic option BEFORE + * the command name. + * - Dispatching a Drush command that uses strict option handling + * using a site alias that contains a command-specific option + * places said option AFTER the command name. + */ + function testDispatchStrictOptions() { + $aliasPath = UNISH_SANDBOX . '/aliases'; + mkdir($aliasPath); + $aliasFile = $aliasPath . '/bar.aliases.drushrc.php'; + $aliasContents = << 'fake.remote-host.com', + 'remote-user' => 'www-admin', + 'root' => '/fake/path/to/root', + 'uri' => 'default', + 'site' => 'stage', + 'command-specific' => array( + 'rsync' => array( + 'delete' => TRUE, + ), + ), + ); +EOD; + file_put_contents($aliasFile, $aliasContents); + $options = array( + 'alias-path' => $aliasPath, + 'include' => dirname(__FILE__), // Find unit.drush.inc commandfile. + 'simulate' => TRUE, + ); + $this->drush('core-rsync', array('/a', '/b'), $options, '@test'); + $output = $this->getOutput(); + $command_position = strpos($output, 'core-rsync'); + $special_option_position = strpos($output, '--site=stage'); + $command_specific_position = strpos($output, '--delete'); + $this->assertTrue($command_position !== FALSE); + $this->assertTrue($special_option_position !== FALSE); + $this->assertTrue($command_specific_position !== FALSE); + $this->assertTrue($command_position > $special_option_position); + $this->assertTrue($command_position < $command_specific_position); + } /* * Assure that site lists work as expected. @@ -18,6 +66,7 @@ $eval = 'print "bon";'; $options = array( 'yes' => NULL, + 'verbose' => NULL, 'root' => $this->webroot(), ); foreach ($subdirs as $dir) { @@ -25,16 +74,12 @@ } $this->drush('php-eval', array($eval), $options, implode(',', $dirs)); $output = $this->getOutputAsList(); - // We sort the output, producing a screwy display, because we cannot - // predict the order of the #dev >> and #stage >> lines, since they - // are executed concurrently, and emitted in a non-deterministic order. - sort($output); - $expected = " #dev + $expected = "You are about to execute 'php-eval print \"bon\";' non-interactively (--yes forced) on all of the following targets: + #dev #stage -#dev >> bon -#stage >> bon Continue? (y/n): y -You are about to execute 'php-eval print \"bon\";' non-interactively (--yes forced) on all of the following targets:"; +#stage >> bon +#dev >> bon"; $this->assertEquals($expected, implode("\n", $output)); } } diff -Nru drush-5.9/tests/siteAliasUnitTest.php drush-5.10.0/tests/siteAliasUnitTest.php --- drush-5.9/tests/siteAliasUnitTest.php 1970-01-01 00:00:00.000000000 +0000 +++ drush-5.10.0/tests/siteAliasUnitTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -0,0 +1,57 @@ + 'fake.remote-host.com', + 'remote-user' => 'www-admin', + 'root' => '/fake/path/to/root', + 'uri' => 'default', + 'command-specific' => array( + 'rsync' => array( + 'delete' => TRUE, + ), + ), + ); + // Site alias which overrides some settings from $site_alias_a. + $site_alias_b = array( + 'remote-host' => 'another-fake.remote-host.com', + 'remote-user' => 'www-other', + 'root' => '/fake/path/to/root', + 'uri' => 'default', + 'command-specific' => array( + 'rsync' => array( + 'delete' => FALSE, + ), + ), + ); + // Expected result from merging $site_alias_a and $site_alias_b. + $site_alias_expected = array( + 'remote-host' => 'another-fake.remote-host.com', + 'remote-user' => 'www-other', + 'root' => '/fake/path/to/root', + 'uri' => 'default', + 'command-specific' => array( + 'rsync' => array( + 'delete' => FALSE, + ), + ), + ); + + $site_alias_result = _sitealias_array_merge($site_alias_a, $site_alias_b); + $this->assertEquals($site_alias_expected, $site_alias_result); + } +} diff -Nru drush-5.9/tests/sqlConnectTest.php drush-5.10.0/tests/sqlConnectTest.php --- drush-5.9/tests/sqlConnectTest.php 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/sqlConnectTest.php 2013-09-26 16:05:05.000000000 +0000 @@ -19,6 +19,12 @@ 'uri' => key($sites), ); + // @todo: extend to other DB platforms. + if (strpos(UNISH_DB_URL, 'mysql') === FALSE) { + $this->markTestSkipped('sql-connect tests need updating for non-mysql UNISH_DB_URL.'); + } + + // Get the connection details with sql-connect and check its structure. $this->drush('sql-connect', array(), $options); $output = $this->getOutput(); $this->assertRegExp('/^mysql --database=[^\s]+ --host=[^\s]+ --user=[^\s]+ --password=.*$/', $output); @@ -27,10 +33,5 @@ $this->execute($output . ' -e "select name from users where uid = 1;"'); $output = $this->getOutput(); $this->assertContains('admin', $output); - - // Get the connection details with sql-connect and check its structure. - if (strpos(UNISH_DB_URL, 'mysql') === FALSE) { - $this->markTestSkipped('sql-connect tests need updating for non-mysql UNISH_DB_URL.'); - } } } diff -Nru drush-5.9/tests/unit.drush.inc drush-5.10.0/tests/unit.drush.inc --- drush-5.9/tests/unit.drush.inc 2013-04-17 20:37:01.000000000 +0000 +++ drush-5.10.0/tests/unit.drush.inc 2013-09-26 16:05:05.000000000 +0000 @@ -135,6 +135,11 @@ foreach (drush_get_global_options() as $key => $info) { unset($all_option_values[$key]); } + if (isset($all_option_values['log-message'])) { + drush_log($all_option_values['log-message'], 'warning'); + drush_log("done", 'warning'); + unset($all_option_values['log-message']); + } return $all_option_values; }