Often, the return valud from drush_op('system', ...) is not checked at all, but when it is, drush is a little bit inconsistent about whether it expects the result to be 0 or FALSE or the textual output of the command that was just executed. The last is what system really returns, but drush was pretty consistent in expecting 0 to be success, or at least !== FALSE to be success.

Since this is wrong and pervasive, I thought that the best way to fix it was to introduce a new function drush_op_system that throws away the output and returns the result of the shell function, as drush expects drush_op to do (but which is impossible for 'system').

(Originally posted in #985716: site install 6 on windows, but these two issues are actually unrelated.)

CommentFileSizeAuthor
drush-op-system.patch9.07 KBgreg.1.anderson

Comments

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I like this a lot.

  1. We are no longer doing anything with $interactive function param?
  2. Lets add a sentence to drush_op() doxygen stating what it *is* used for. We have text about non-use only.

After that, RTBC.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Yes, $interactive is still used, and drush_op does have text for what it is used for. These items are not clear in the patch, but are visible in the source.

Committed.

greg.1.anderson’s picture

Accidentally broke drush_shell_exec in #0. Fixed in http://drupal.org/cvs?commit=461412

Status: Fixed » Closed (fixed)

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