optparse adds an "options" method to ARGV, and so does Homebrew.
Rename this method (and remove optparse blocking script) so that
Homebrew plays nicer with external Ruby software.
This fixes the issue where "gem install thin" would break
"brew server", for instance.
Kernel#system special-cases the first argument, so you have to
make the first argument the entire command to be invoked, and
subsequent arguments the actual arguments to that command. In
order to use the user's interpreter, the first argument must be
"/usr/bin/env <name>".
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
RubyCocoa is a large dependency, and any large system can cause unexpected errors. In this case the user's system was badly setup and RubyCocoa caused a dynamic loader issue.
We don't use beer_events currently due to other bugs that occurred sporadically with its use. So requiring it is unnecessary. So lets save ourselves trouble.
FixesHomebrew/homebrew#487
It's a great feature but it seems to conflict with our new system() replacement. Clearly the bug is still in our system() but what exactly it is is not clear and this bug sucks.
See Homebrew/homebrew#124
It just seems to behave strangely with SIGINT. Eg. SIGINT causes tar to exit, but the SIGINT is ignored by our process. This is not the case when used with curl.
Couldn't make this atomic, apologies.
Fixes a few things, like deps failing to build not aborting the install.
--force now works properly again.
Overall more robust code. I went back over it all and gave it a lot of
thought.
Cleaner separation of logic. Less code in brew, now the only code there is
ARGV handling, and basic sanity checks.
Not extending ARGV or ENV in global now as that would propagate to other tools
or utilities you may write.