This ended up being noise for some users. We need a better set of steps
to trigger the bug in order to create a good doctor check; patches
welcome from users who are encountering this issue.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Git checkouts that do not specify a branch should always reset to the
remote's HEAD, as some remotes have HEAD set to 'unstable' or some other
non-master branch.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Homebrew was attempting to check the version of gcc-4.0 and gcc-4.2 even
if they don't exist, causing `doctor` and `--config` to throw nasty
errors.
Also fixes the broken missing gcc-4.2 detection, which was confusing
Xcode 4.2 users.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
The recommended compiler versions printed from `brew-config` are out
of date and misleading. The recommendation is always "Run the latest
version of Xcode available for your platform".
Xcode 3.2.6's build of clang is 77, which wasn't being matched by the
clang_build_version regexp.
ClosesHomebrew/homebrew#8796.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
For GCC and LLVM-GCC, '-v' is not a synonym for --version. When run
without any other options or arguments, it gives similar output, but it
is better to just parse the (terser) --version output.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`brew options --installed` will now "do the right thing".
There is getting to be a small but noticeable amount of code duplication
among commands that take options like "--installed" or "--all"; it may
be worth factoring this out into a method that will return a collection
of formula objects based on the options that are passed.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Often it is useful to provide a development build in addition to the
stable release or HEAD download.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
For now, don't strip `--HEAD` from `ARGV` prior to forking for install.
Currently this doesn't work because the formula object the installer is acting
on has its `prefix` set while under the influence of `--HEAD`. So, the
installer bails out when it sees that nothing is installed to `f.prefix`.
This is a hotfix for issue Homebrew/homebrew#8668 to allow formulae to keep building. A proper
fix should ensure that formula installers are operating on objects with
appropriately set `prefix` values.
Running brew doctor creates a temporary directory in $HOMEBREW_TEMP or
/tmp but does not clean it up afterwards. This patch deletes the
directory created to prevent polluting $HOMEBREW_TEMP or /tmp with empty
directories.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
We don't want single letter options like '-v' or '-d' to unintentionally
trigger formula-specific options.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The `filtered_args` method added to the `FormulaInstaller` makes a call
`ARGV.formulae`. Unfortunately, `ARGV.formulae` will throw a
`FormulaUnspecifiedError` instead of returning an empty list. This patch
avoids the issue by checking `ARGV.named.empty?` before calling
`ARGV.formulae`.
FixesHomebrew/homebrew#8576.
The `multi_json` gem dynamically selects a JSON implementation from a list of
candidates. Since we cannot control which gems are installed on a user's
machine, this patch hardwires `multi_json` to use the included copy of `ok_json`.
`ok_json` is a pure-Ruby JSON encoder/decoder that is bundled with
`multi_json`. `ok_json` may not be as fast as other choices, but speed is not
critical for our application.
ClosesHomebrew/homebrew#8574.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
FormulaInstaller now loads the install recipt of a previous install and appends
the `used_options` to ARGV before forking to build. This means `brew upgrade`
will "remember" which options were invoked for the last install and re-use
them.
FixesHomebrew/homebrew#5250.
Multi-JSON is a library that provides encode/decode support for casting Ruby
objects to JSON strings and back again. This version of the library has been
tested against ruby versions 1.8.6 and later.
Having a JSON encoder/decoder in the toolbox helps now that the GitHub API only
returns results in JSON format.
`ARVG` is now filtered before the formula installer forks a new process. This
allows a chance to do things like strip out `--HEAD` flags for formulae that
weren't explicitly passed as arguments but came in as dependencies.
FixesHomebrew/homebrew#7724.
It is often useful to be reminded that you are, in fact, in the middle
of a debug or interactive install. We provided this reminder in the form
of HOMEBREW_DEBUG_INSTALL, but we can make this even easier for the end
user to consume by exposing it in the form of a shell function.
When HOMEBREW_DEBUG_INSTALL is set, the __brew_ps1() function returns
the string "(formula_name|DEBUG)" by default (much like the __git_ps1()
output when performing some long-running operation, e.g.
"(branch|REBASE-i)". The formatting around "formula_name|DEBUG" can be
customized by passing a format string to the function.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This would silently fail if HOMEBREW_REPOSITORY != HOMEBREW_PREFIX,
which is obviously a valid Homebrew setup.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
A terminal width of 262 or greater can trigger a buffer overflow in
curl's progress bar code, resulting in a segfault and aborted downloads.
Warn about this.
cf Homebrew/homebrew#8521.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Sometimes you want to know what `brew cleanup` will do before it
actually removes anything. Introduce a '-n' option (chosen to match
other UNIX tools) to do this.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
There was an UnsafeSubversionDownloadStrategy in a single formula
before, but a) it broke against later changes to
SubversionDownloadStrategy, and b) wasn't available to other formula.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This will actually throw some possibly unwanted warnings, e.g. whining
about using mirrors.kernel.org for Debian software; we might only want
that warning for the default URL.
Perhaps mirrors deserve their own audit_formula_mirrors, but rather than
duplicate code, let's just check them against the standard criteria for
now.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
brew-unpack was failing for formulae that satisfy fails_with_llvm? as
handle_llvm_failure() requires our ENV extension to get ENV.compiler.
Rather than requiring extend/ENV, just define fails_with_llvm? as false
since we don't really care about that when just unpacking a formula.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>