2249 Commits

Author SHA1 Message Date
Xiyue Deng
2d445d54b5 Add tex requirement
* Detect `latex' and `bibtex' commands.
* Recommend installing MacTeX when no LaTeX installation is found.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-13 18:25:35 -08:00
Jack Nagel
8f88850cdb Only mark install as attempted if it was actually attempted
Commit 30a08f5cc707 ("Don't attempt installation multiple times") was
correct in raising FormulaInstallationAlreadyAttemptedError early enough
to prevent the other exceptions in #check_install_sanity from being
raised, but it should not have moved the point at which formulae are
added to the attempted set. Doing so prevents the installer from being
instantiated multiple times on the same formula, even if installation
was never attempted.

Put it back where it belongs.
2013-01-13 15:46:46 -06:00
Jack Nagel
900a5fec2d Beef up deps tests 2013-01-12 21:20:46 -06:00
Jack Nagel
09b77a7785 Define HOMEBREW_LIBRARY for tests 2013-01-12 17:51:29 -06:00
Samuel John
bc3c07d197 Give a fresh 🍺 after hard work of brew install
- Name of the brewed formula in "Summary" heading.
- At the beginning of the summary line a 🍺  is given out
  (but only on Lion or above). This acts as a nice
  visual marker for the end of a brew-ing process.
- When brewing a dependency, the name is highlighted in green.
- `oh1` is bold, too (like ohai).

Closes Homebrew/homebrew#16020.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-11 11:16:11 +00:00
Jack Nagel
5c799ef8c8 Don't attempt installation multiple times
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.

For example:

  $ brew install graphviz pkg-config
  ==> Installing graphviz dependency: pkg-config
  ...
  ==> Installing graphviz
  ...
  Error: pkg-config-0.27.1 already installed

We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.

Fixes Homebrew/homebrew#16957.
2013-01-10 16:46:54 -06:00
Samuel John
4291bc29db Make MPIRequirement satisfied on Xcode-only Macs
Closes Homebrew/homebrew#16409.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-10 16:02:07 -06:00
Jack Nagel
951620f146 Restore ARGV even if an exception is raised 2013-01-10 15:57:21 -06:00
Jack Nagel
79295ecaf8 More robust way to avoid attempting to marshal Procs 2013-01-09 19:25:02 -06:00
Jack Nagel
003a9e7fd7 Don't store test Proc if we might need to marshall the formula
Procs cannot be marshalled, but formula objects may be as part of the
BuildError exception. If the formula object has a reference to a Proc,
this will fail.

Work around it by not storing the test Procs during installations.
2013-01-09 18:33:35 -06:00
Jack Nagel
0949d952dc Define Symbol#to_proc for Ruby 1.8.6
Ruby 1.8.6 doesn't have Symbol#to_proc, which allows things like
map(&:to_s) rather than map { |o| o.to_s }. 1.8.7 does, though, and
since it is used in a bunch of the superenv code we should attempt to
keep it compatible with 1.8.6.

Closes Homebrew/homebrew#16046.
2013-01-09 17:36:17 -06:00
Misty De Meo
05772f8ccf doctor: use -V for python version
`python --version` doesn't work in some (very) old versions of
python. While I doubt this is going to come up very often, it's
theoretically possible someone has an old python first in their
path. (python -V works on all versions I'm aware of, including
python3, and comes before --version in the --help anyway.)

Also skips the warning in case the regexp matches nothing, which
probably shouldn't happen. But if it does we shouldn't produce the
wrong warning.
2013-01-09 17:09:28 -06:00
Jack Nagel
4dffd3beb9 Set userpaths before processing requirement ENV modifications 2013-01-09 11:46:51 -06:00
Adam Vandenberg
47dcc3f770 Cleaner: allow non-empty paths to be pruned from cleaning 2013-01-08 21:27:30 -08:00
Mike Lapinsky
1815e6caa1 Don't remove linked formulas when doing a 'cleanup'
Closes Homebrew/homebrew#16947.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-08 09:50:12 -08:00
Jack Nagel
e3068f631a Prune LinkedKegs relative to correct path
Fixes Homebrew/homebrew#16948.
2013-01-08 11:03:13 -06:00
Jack Nagel
c2fd7856d2 Prevent repeated lookups of nil-valued keys 2013-01-08 10:21:28 -06:00
Jack Nagel
dfa387700d Allow conversion of Dependencies to Array
This is needed for the intersection code in `brew deps` to work right,
but can hopefully be refactored away somehow eventually.
2013-01-07 18:17:51 -06:00
Jack Nagel
967a60a054 Detect when tests are defined 2013-01-07 17:37:28 -06:00
Jack Nagel
429caf69a9 Remove Array subclassing
Inheriting from Array (and other core types) is problematic:

  - It exposes a very wide interface with many methods that are not
    really relevant to the subclass.
  - It can cause some weird side effects, as many Array operations are
    in C and have hardcoded return values; for example, combining two
    array subclasses returns a new Array instead of the subclass.

Avoid these problems using delegation and the Enumerable module where
applicable.
2013-01-07 14:32:14 -06:00
Mike McQuaid
7473d2b12f Fix local bottle installation with hyphens. 2013-01-07 20:27:27 +00:00
Jack Nagel
6641fc4017 version: mark some implementation details as protected 2013-01-07 11:59:33 -06:00
Jack Nagel
1c99c68594 Allow tests to be specified in the DSL
Tests can now be specified as a block in the DSL. A temporary test
directory is set up automatically when calling Formula#test. The
semantics of the test remain the same: the block can either raise an
exception or return false to signal failure.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-01-06 21:22:31 -06:00
Adam Vandenberg
30114c4c70 brew update: warn about adamv/homebrew-alt 2013-01-06 17:06:38 -08:00
Alex Reece
6672ef5f9f Add support for external ocaml deps via opam
Closes Homebrew/homebrew#16280.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-04 21:50:31 -08:00
Adam Vandenberg
2a40ff08a2 Only add -F if the frameworks folder exists
Closes Homebrew/homebrew#16901.
2013-01-04 21:30:10 -08:00
Adam Vandenberg
4bcdb8aeb3 audit: remove silly audit, remove duplicate audit 2013-01-04 09:30:57 -08:00
Adam Vandenberg
a0d53f7bc1 audit: check conflict names 2013-01-03 11:22:31 -08:00
Adam Vandenberg
a5e969dfb5 superenv: make HOMEBREW_FILE available
Superenv scripts have a stripped PATH, which may not include
the brew binary itself. Make this explicitly available to
superenv scripts.

Fixes bsdmake wrapper.

Closes Homebrew/homebrew#16805.
Closes Homebrew/homebrew#16846.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-03 09:14:36 -08:00
Jack Nagel
7a4facae2f Guess system XQuartz version when mdfind fails
Fixes Homebrew/homebrew#16857.
2013-01-02 23:20:06 -06:00
Mike McQuaid
755a2fbe52 Add caveats class and use in brew info.
Probably a better approach than reverted e721c7.

Fixes Homebrew/homebrew#16604.
2013-01-02 09:28:15 +00:00
Mike McQuaid
da0c0ae97a Cleanup FormulaInstaller caveats. 2013-01-02 09:28:15 +00:00
Mike McQuaid
df2cdc681a Add Apache version style test. 2013-01-01 17:30:57 +00:00
Cyril Scetbon
4fc76a67d4 Add Apache version style.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-01 17:30:52 +00:00
Mike McQuaid
f25e7de43b Add --homebrew-developer flag 2013-01-01 16:39:06 +00:00
Jack Nagel
de1eabf22c Fix some doublethink in the Xcode module
Xcode.prefix and Xcode.installed? use slightly different heuristics to
find Xcode. In fact, .installed? basically duplicates a portion of the
.prefix logic. In practice, the methods results are usually consistent,
but .installed? does not handle non-standard prefixes if mdfind cannot
locate Xcode (for example, if the user has disabled Spotlight indexing).

Since .installed? is essentially a subset of the .prefix logic, we can
rely on the result from .prefix instead.

Fixes Homebrew/homebrew#16790.
2012-12-30 19:23:53 -06:00
Jack Nagel
9362a7c897 Respect BROWSER environment variable 2012-12-27 23:41:44 -06:00
Misty De Meo
1bce10ad6c Replace sceaga/homebrew with mistydemeo/tigerbrew
@sceaga has discontinued his homebrew fork, so tigerbrew is now PPC/
Tiger users' best bet.
2012-12-27 21:55:15 -04:00
Misty De Meo
d6299af86c utils: replace shell which with native code
Originally written for tigerbrew, but useful enough for core.
Replaces the shelled-out which in utils.rb with a native-ruby
equivalent, which is moderately faster.

Closes Homebrew/homebrew#16659.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-12-27 19:37:21 -04:00
Jack Nagel
9c8a73cf41 Allow requirements to specify env options 2012-12-26 14:37:03 -06:00
Jack Nagel
f8d253950f Add a small DSL for setting requirement options 2012-12-26 14:37:02 -06:00
Jack Nagel
a358bee8e2 Clean up BuildEnvironment interface a bit 2012-12-26 14:37:02 -06:00
Jack Nagel
a56a0dadad Try to find XQuartz via pkgutil if mdls fails
c.f. Homebrew/homebrew#16296.
2012-12-22 14:27:22 -06:00
Jack Nagel
d2d4813a07 doctor: add helper for printing file listings 2012-12-22 12:48:53 -06:00
Jack Nagel
4e9128aa6c doctor: f.prefix is already a pathname 2012-12-21 19:33:24 -06:00
Jack Nagel
2b47739822 doctor: print offending paths in check_for_gettext
c.f. Homebrew/homebrew#16688.
2012-12-21 18:03:24 -06:00
Jack Nagel
847547167a doctor: rename path_folders to paths 2012-12-21 17:16:57 -06:00
Jack Nagel
1780855023 doctor: use a more rubyish conditional 2012-12-21 17:14:01 -06:00
Jack Nagel
73a206a316 doctor: avoid pointless creation of pathname object 2012-12-21 17:12:00 -06:00
Jack Nagel
a64e9e542f doctor: run slowest checks last 2012-12-21 15:15:42 -06:00