Since we are loading options as Formula#build from tab, we will have to explicitly read
options from ARGV as well.
Fixes#3066.
Closes#537.
Signed-off-by: Xu Cheng <xucheng@me.com>
Substitue each Version.new and HeadVersion.new with Version.create
to unify Version and HeadVersion instantiation among core code.
Note that this does not relate to Mac::OS::Version class.
Move some stuff formerly in `Library/ENV` around:
- Move `Library/ENV/$XCODE_VERSION` to `Library/Homebrew/env/super` as they are
all superenv wrappers and all symlinks to the same version. We never needed
the "separate shims for separate versions" functionality and it just adds
confusion.
- Move `Library/ENV/pkgconfig` to `Library/Homebrew/env/pkgconfig` to get more
things under `Library/Homebrew`
- Move `Library/ENV/scm` to `Library/scm` as these wrappers are not actually
used by or related to superenv (or stdenv) in any way.
Regex is way slower than normal String#include? and String#start_with?.
Also, we often forget to proper escape them. So avoid using them if it
is not necessary.
Closes#503.
Signed-off-by: Xu Cheng <xucheng@me.com>
Changes to our style configuration:
- Consolidate all rules related to Ruby 1.8 compatibility in one place.
- Codify our de-facto preference for `alias_method` over `alias` (drops
offense count by 54 after turning this on).
- Drop `Style/SignalException` as `only_raise` has been the new default
for quite a while (since RuboCop 0.37.0).
We might as well be consistent about it, since it's not obvious to people
what the next step is after we've pointed out the directory isn't writable.
Fixes#476.
* readall: move readall logic to new class.
* tap: run readall when tapping.
This will prevent tapping an tap with syntax errors from causing issues
for users.
Fixes#58.
* Don't infinitely recurse `brew update --preinstall`.
This could happen when trying to `brew install git` inside `brew update
--preinstall`.
* update.sh: cache Git PATH.
We don’t need to look it up from superenv every time; this is slow.
* update.sh: print message before preinstall updates.
* update.sh: verbose output fetch directory.
This aids reading `brew update --verbose --debug` output.
* update.sh: skip taps without formulae on preinstall.
We don’t need to update them as we’re not invoking them.
* update.sh: don't force update-report on developer preinstall.
This is too slow.
This reverts commit 252c701c59227c385ef6178fe99523cca8c843bb.
Taps installed prior to running the test suite are not visible to the
test suite as most Homebrew paths are redefined as to not mess up the
local installation.
All of these taps use Homebrew internal APIs (or will shortly) and we
autoinstall them all from `brew $CMD`. We should adjust our CI to ensure
that we never accidentally break these taps when making changes to core
code so that these taps can rely more on this core code rather than
having to e.g. vendor equivalent code that never changes on our end.
Set HOMEBREW_NO_GITHUB_API to allow running all tests (but search's
integration test specifically for now) offline. This can be overridden
with `--online`.
Tweak `Style/NumericLiteralPrefix` cop settings as we're using octal
literals a lot (both in formulae and the package manager) for file
permissions and aren't ready just yet to transition them to the more
beginner-friendly `0o` prefix (instead of the more obscure `0` prefix).
Do this to ensure that any symlinks in the Homebrew prefix and/or in
Applications are removed to stop issues with stale symlinks causing
Casks from being installed correctly.
This is inspired by `safe_system` with basically the same implication
(fail on error), making the name a lot less confusing and avoiding a
clash with the `chdir` function previously defined in `bin/brew`.
Closes#414.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>