We override ENV[] to always return strings under superenv, because
legacy formulae assume that CFLAGS, etc. are non-nil.
However, the current implementation has a bug. If I simply concatenate
ENV['CFLAGS'] with another string, it mutates ENV['CFLAGS']:
irb> ENV['CFLAGS']
=> ""
irb> ENV['CFLAGS'] + 'a'
=> "a"
irb> ENV['CFLAGS']
=> "a"
Instead, let's simply return an empty string if the key doesn't exist.
This is sufficient because the following are equivalent:
1. ENV['CFLAGS'] += "string"
2. ENV['CFLAGS'] = ENV['CFLAGS'] + "string"
This defines the new HOMEBREW_ARCHS environment variable, which is
currently only set during universal builds, so that the tool wrappers
no longer need to hardcode i386/x86_64.
Up to now a brewed Python, even if not linked, was preferred over
and external Python, so that you had to completely `brew rm python`
to have a formula link against external (mostly system) Python.
From now on it is okay to `brew unlink python`.
Now, we can finally stop stuggesting to
`brew rm <foo>` and then `brew install <foo> <with-your-preferred options>
So `brew reinstall` will honor all options that have been recorded
into the INSTALL_RECEIPT.json plus if `--build-bottle` was used.
If the `src` in the Cellar of a formula is a symlink to another dir
in the same Cellar (for example `Frameworks/QtGui.framework` is a
symlink to `lib/QtGui.framework`), then we should make a symlink
directly instead of possibly creating an empty dir.
This is needed because Ruby's `find` does not follow symlinks (newer
versions can, but we have to support 10.8 for a long time).
Currently this probably only occurs for Qt, where we put symlinks
into the Cellar/Frameworks and the frameworks linking code is a bit
special to create a directory to "merge" together different versions
of the same framework from different formulae. See `python` and
`python3`; both install `Python.framework` and only one can be the
`Current` but the other should still be put into
`Python.framework/Versions`. Therefore `Python.framework` has to
be a dir and no symlink.