1538 Commits

Author SHA1 Message Date
Misty De Meo
f017f2d2f5 Utils: update gcc version detection logic
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>
2011-11-25 17:50:14 -08:00
Adam Vandenberg
0fd47f2014 brew-config: remove recommended compiler versions
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".
2011-11-25 17:34:47 -08:00
Misty De Meo
6612e49a3c Detect 2-digit clang build versions
Xcode 3.2.6's build of clang is 77, which wasn't being matched by the
clang_build_version regexp.

Closes Homebrew/homebrew#8796.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-25 17:54:21 -06:00
Jack Nagel
265ea4d1fb Display clang version in --config output
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-25 13:15:47 -06:00
Jack Nagel
6fce434857 Add utility methods to determine clang version
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-25 13:14:46 -06:00
Jack Nagel
a1df77f3b7 doctor: remove outdated XCode version reference
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-25 13:02:54 -06:00
Jack Nagel
a99b745935 Parse compiler --version instead of -v
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>
2011-11-25 13:00:59 -06:00
Charlie Sharpsteen
e04e23492c formula_installer.rb: Improve receipt check
Using `f.installed?` instead of `f.prefix.exist?` ensures something was created
by the installation step before the install receipt is written.
2011-11-23 12:25:00 -08:00
Jack Nagel
17d83b735a audit: check for MacPorts patches from trunk
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-23 13:38:38 -06:00
Charlie Sharpsteen
399d73e100 ENV.rb: Fix typo in Fortran environment variables
`FFFLAGS` should be `FFLAGS`.
2011-11-23 09:25:22 -08:00
Jack Nagel
75a7c33e6a options: treat outdated brews as installed
`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>
2011-11-22 19:29:10 -06:00
Jack Nagel
b62bd90a1d Define and use ARGV.build_devel?
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>
2011-11-21 20:04:33 -08:00
Charlie Sharpsteen
39b3ed3c33 formula_installer.rb: Hotfix for head installs
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.
2011-11-21 11:26:05 -08:00
Charlie Sharpsteen
31eba09830 audit.rb: Check version strings by default
Tired of telling people that version numbers are redundant. Just check it by
default since the `--strict` flag to `brew audit` is not well advertised.
2011-11-21 09:00:34 -08:00
Jonathan Grochowski
92faeb79b2 Delete temp directory created during brew doctor
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>
2011-11-20 13:22:43 -08:00
Jack Nagel
7e57847793 audit: check for ARGV.flag? in formulae
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>
2011-11-18 15:27:09 -06:00
Charlie Sharpsteen
6c4d3a15d6 Don't include receipt in brew list output
Fixes Homebrew/homebrew#8615.
2011-11-16 10:43:44 -08:00
Charlie Sharpsteen
eefbf00963 Don't write receipt for empty installs
Fixes Homebrew/homebrew#8616.
2011-11-16 10:42:02 -08:00
Jack Nagel
ebfa4d5dc0 audit: don't check duplicate URLs
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-15 18:06:26 -06:00
Adam Vandenberg
f2b43831f5 Mercurial 1.9.3 2011-11-15 09:03:12 -08:00
Charlie Sharpsteen
33a61d1897 Add --fresh option to brew install
When invoked, this option will ensure brew doesn't re-use any options from
previous installs of a formula.
2011-11-14 10:44:18 -08:00
Charlie Sharpsteen
8ec2d8e043 Hotfix for filtered_args breaking brew upgrade
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`.

Fixes Homebrew/homebrew#8576.
2011-11-14 08:22:59 -08:00
Jack Nagel
9e5c0da85b info: display used options for installed formulae
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-13 23:27:53 -06:00
Charlie Sharpsteen
7248afc490 Hardwire multi_json backend
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.

Closes Homebrew/homebrew#8574.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-11-13 19:23:00 -08:00
Charlie Sharpsteen
0dc87a5100 Add copyright notice for MultiJson 2011-11-13 13:15:06 -08:00
Charlie Sharpsteen
ec1c7aaa38 metadata: Use options from previous installs
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.

Fixes Homebrew/homebrew#5250.
2011-11-13 12:14:56 -08:00
Charlie Sharpsteen
028104b861 metadata: Record installation options
Adds a new class called `Tab` that acts as a recipt for install options. A
`Tab` can be serialized to a JSON file for future reference.
2011-11-13 12:14:56 -08:00
Charlie Sharpsteen
1d1cd374b3 Vendor Library: multi-json 1.0.3
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.
2011-11-13 12:14:55 -08:00
Charlie Sharpsteen
cb681ffff6 formula_installer.rb: Pre-process ARGV before fork
`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.

Fixes Homebrew/homebrew#7724.
2011-11-13 12:14:55 -08:00
Jack Nagel
0474fa11cd completion: add __brew_ps1 to annotate $PS1
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>
2011-11-11 00:01:05 -06:00
Jack Nagel
6b9fa0b818 doctor: check_git_status in correct location
This would silently fail if HOMEBREW_REPOSITORY != HOMEBREW_PREFIX,
which is obviously a valid Homebrew setup.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 22:53:10 -06:00
Jack Nagel
784e3b2dfd doctor: document curl/terminal width issue
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 22:52:18 -06:00
Jack Nagel
c0eb8a3bc8 doctor: warn about wide terminals
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>
2011-11-10 20:47:17 -06:00
Jack Nagel
e7947f4f92 doctor: minor grammatical fix
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-10 19:49:26 -06:00
Jack Nagel
0cc3eb296d cleanup: add an option to perform a 'dry run'
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>
2011-11-07 22:46:36 -06:00
Oleg Oshmyan
323c30978f audit: check for build_universal? calls if --universal unused
Closes Homebrew/homebrew#8123.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-02 19:02:53 -05:00
Jack Nagel
2c3b107d93 audit: check for empty sha256 checksums
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-11-02 18:55:27 -05:00
Charlie Sharpsteen
a6877c02b0 brew-pull: Clarify comment concerning whitespace 2011-10-24 19:07:59 -07:00
Charlie Sharpsteen
d54e7fb4de brew-pull: Add flag to suppress whitespace fixes
When the pull request includes a patch, fixing whitespace can break the patch.
2011-10-24 18:55:43 -07:00
Adam Vandenberg
cbdb603838 Remove debian mirror check; it is just noise 2011-10-22 09:37:10 -07:00
Misty De Meo
1e17a8fb0b Add UnsafeSubversionDownloadStrategy
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>
2011-10-22 08:04:26 -07:00
Jack Nagel
9a9846814f doctor: correctly detect CLICOLOR_FORCE
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-18 20:10:57 -05:00
Adam Vandenberg
0dbf06bbc8 audit: complain more about tabs 2011-10-18 10:00:45 -07:00
Jack Nagel
8848857cea audit: check mirror URLs
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>
2011-10-15 00:39:05 -05:00
Jack Nagel
85b17ecb4e brew-unpack: define fails_with_llvm? as false
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>
2011-10-14 23:55:45 -05:00
Misty De Meo
6ab97f75be add Xcode to the blacklist
Closes Homebrew/homebrew#8106.

Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
2011-10-14 19:07:28 -07:00
Jack Nagel
4da0b506f4 Add bash completion for subcommand options
We already have option completion for `brew install`; now we have it for
all core commands, and the --cache, --cellar, and --prefix flags now
have appropriate formula completion.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-12 02:57:28 -05:00
Jack Nagel
15706ec7d4 Redocument brew missing in the man page
Per mxcl/homebrew@6b0c44d, @mxcl:

  "And in that mind, brew missing is some cases an essential tool and
   should absolutely be in the manpage."

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-12 02:53:41 -05:00
Jack Nagel
b8b7ad7ef2 Document brew diy in the man page
The documentation on this is hard to find, and awareness of the command
itself is pretty low. Which is too bad, because it's really handy and I
use it all the time myself.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-12 02:53:40 -05:00
Jack Nagel
203b0df596 man page: add some undocumented options
While updating the bash completion script, I encountered some options
that were previously undocumented.

I purposely did not document the --macports and --fink flags for `brew
create`, because the exact same functionality exists in `brew search`.
Perhaps we should remove it from create.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-10-12 02:53:40 -05:00