This allows us to force using the system Ruby on OSX but allow
the development of Homebrew for Linux or Windows to not rely
on OSX paths.
ClosesHomebrew/homebrew#17548.
Let's not show weird error messages when user interrupts during various stages of brew initialization.
Tested by doing `for x in $(brew search); do brew install $x; done` and pressing CTRL-C at random short intervals.
Fixes a case where brew would find commands with wrongly-capitalized
user input on case-insensitive systems, then error out with a confusing
message when an invalid method was sent to Homebrew. e.g.:
> brew Update
Error: undefined method `Update' for Homebrew:Module
We don't want bug reports about this crap, even though the user REALLY should listen to the warning message. What actually happens is they blame us instead.
This kind of warning in particular:
warning: Insecure world writable dir /usr/local/bin in PATH
Rationale: some users insist on replacing the /usr/bin/ruby symlink
to point to another ruby on their system, which may break homebrew.
Use the full Framework path instead, which is less likely to be tampered with.
This also reorganizes the brew --config checks to reflect the different path.
FixesHomebrew/homebrew#12009.
ClosesHomebrew/homebrew#12333.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
'which' only returns a Pathname or nil, and doesn't care about anything
sent to stderr, so just silence it by default and combine the two
methods.
ClosesHomebrew/homebrew#12115.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`brew install > file` should not give "export CC=/foo" output on Build Failures.
Also moved the "Using clang" output to brew when BuildError is thrown as that is where it is interesting, and not if you just do `brew --env`.
Rationale: people break their installs by mixing sudo and non-sudo usage. They are used to having to `sudo port install` and shit like that, so I understand why the mixing happens.
* may be a problem if the constant is scoped (like A::B), but this is not the case
(const.split('::').inject(Object) { |c, part| c.const_get part } would solve that)
* this was noticed in a comment of 9afc85ad but it has disappeared
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.
But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.
If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.
Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
HOMEBREW_CACHE isn't really helpful in diagnosing problems, and some
people don't like their username / home folder going into bug reports
on the web, so let's take it out.