24630 Commits

Author SHA1 Message Date
Adam Vandenberg
99850fcbda Formula::finalize_dsl 2013-01-26 12:14:45 -06:00
Jack Nagel
37a56fa513 FormulaInstaller: implement installation locks
FormulaInstaller now attempts to take a lock on a "foo.brewing" file for
the formula and all of its dependencies before attempting installation.

The lock is an advisory lock implemented using flock(), and as such it
only locks out other processes that attempt to take the lock. It also
means that it is never necessary to manually remove the lock file,
because the lock is not enforced by I/O.

The uninstall, link, and unlink commands all learn to respect this lock
as well, so that the installation cannot be corrupted by a concurrent
Homebrew process, and keg operations cannot occur simultaneously.
2013-01-26 12:14:45 -06:00
Jack Nagel
ea4188ecda FormulaInstaller: skip build-time deps for bottles 2013-01-26 12:14:44 -06:00
Jack Nagel
43d9f480af FormulaInstaller: factor out dependency installation 2013-01-26 12:14:44 -06:00
Jack Nagel
8b346d7a6d FormulaInstaller: factor out requirement checking 2013-01-26 12:14:44 -06:00
Jack Nagel
e9e16fefa9 Dependency#to_formula and associated helpers 2013-01-26 12:14:44 -06:00
Jack Nagel
a569261a9b Formula#recursive_dependencies
This behaves like recursive_deps, but the resulting list consists of
Dependency objects instead of Formula objects. The list maintains the
installable order property of recursive_deps.

While in the area, add some comments clarifying the purpose of related
methods.
2013-01-26 12:14:43 -06:00
Jack Nagel
02b8d34339 Tab#with? to mirror BuildOptions#with?
Eventually a common interface could be factored out into a module, but
for now this will suffice.
2013-01-26 12:14:43 -06:00
Jack Nagel
e2c4a05235 Tests for BuildOptions 2013-01-26 11:37:02 -06:00
Jack Nagel
5088fdd543 Move BuildOptions to a separate file 2013-01-26 11:37:02 -06:00
Jack Nagel
70ff06c827 Refactor option handling internals
Currently we handle options in several ways, and it is hard to remember
what code needs an option string ("--foo"), what needs only the name
("foo") and what needs an Option object.

Now that Option objects can act as strings and be converted to JSON, we
can start using them instead of passing around strings between Formula
objects, Tab objects, and ARGV-style arrays.

The Options class is a special collection that can be queried for the
inclusion of options in any form: '--foo', 'foo', or Option.new("foo").
2013-01-26 11:37:01 -06:00
Jack Nagel
26b1b88c97 BuildOptions: check has_option? for universal and 32-bit 2013-01-26 11:37:01 -06:00
Jack Nagel
cbf0fe6549 BuildOptions: simplify setting description 2013-01-26 11:37:01 -06:00
Jack Nagel
4062559acb Options can be dumped as JSON 2013-01-26 11:37:01 -06:00
Jack Nagel
a5471a0cb0 Options can be used interchangeably with Strings
We want to be able to use Option objects in place of strings and have
this be transparent. Defining to_str means that methods like
Kernel#system and Kernel#exec will be able to perform an implicit
conversion.
2013-01-26 11:37:01 -06:00
Jack Nagel
f3d3bc4368 Move option comparison into BuildOptions 2013-01-26 11:37:00 -06:00
Jack Nagel
d8a83073ff Clean up Tab creation 2013-01-26 11:37:00 -06:00
Mike McQuaid
a3daca1b13 Allow depending on requirement class or instance. 2013-01-26 14:33:05 +00:00
Mike McQuaid
ff4baa3fcc brew-cleanup: don't whine about permission denied.
Closes Homebrew/homebrew#14359.
2013-01-26 14:11:06 +00:00
Mike McQuaid
5fd9c56803 Add tmux warning for launchctl caveats.
References Homebrew/homebrew#13951.
2013-01-26 14:06:48 +00:00
Mike McQuaid
21f1efcba6 We use formulae as the plural of formula. 2013-01-26 13:16:55 +00:00
Mike McQuaid
bb8c22c90d brew-test: use SHA-1 in all testballs. 2013-01-26 13:10:06 +00:00
Mike McQuaid
de8d5cfc92 manpage: remove outdated MD5 references. 2013-01-26 13:02:21 +00:00
Mike McQuaid
6f17f25b5f brew-mirror-check: Not using MD5 any more. 2013-01-26 12:59:57 +00:00
Mike McQuaid
239217e944 brew-fetch: remove MD5 output. 2013-01-26 12:48:00 +00:00
Mike McQuaid
7120f47f6c brew-test-bot: don't use stash --all; too new. 2013-01-26 12:43:41 +00:00
Samuel John
293be41d5c superenv: Allow ENV.m32 (for 32bit builds)
Superenv normally filters out "-m32" flag, preventing 32bit builds.
Some software, however, still only work in 32bit mode.

If ENV.m32 is called, superenv does not filter out the "-m32" flag.
Also note, superenv, does not explicitly add the -m32 flag and
expects the build system of the software to know when and where to
provide this flag.

Closes Homebrew/homebrew#16350.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-24 19:21:57 -08:00
Adam Vandenberg
2c6a7bdca8 Check ownership of logs folder
Closes Homebrew/homebrew#16607.
2013-01-23 20:12:55 -08:00
Samuel John
04d22a88b1 brew search looks in samueljohn/python, too.
Closes Homebrew/homebrew#17267.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-23 19:53:46 -08:00
Adam Vandenberg
05eb740766 Add Homebrew-completions to search 2013-01-23 19:53:06 -08:00
Jack Nagel
0a9f5c6867 CurlApacheMirrorDownloadStrategy: fetch mirrors in JSON format
Closes Homebrew/homebrew#16457.
2013-01-23 18:01:06 -06:00
Jack Nagel
8135ed6528 superenv: allow -W[alp], style arguments to pass through
We already (correctly) allow -Wl, style linker arguments to pass
through; extend this to -Wp, (preprocessor) and -Wa, (assembler).

Fixes Homebrew/homebrew#17252.
2013-01-23 00:18:01 -06:00
Jack Nagel
3725f771de Infer path to be added for requirements that search PATH
When a requirement is specified like:

  satisfy { which "foo" }

There is no reason that we should inject all of ENV.userpaths! into the
build environment. Instead, infer the directory to be added to PATH from
the Pathname that is returned.

This is another step towards condensing the "which program" requirements
down into a one-liner DSL element.
2013-01-22 14:59:10 -06:00
Jack Nagel
b9e5f1229b requirements: enable userpaths by default during evaluation 2013-01-22 14:11:21 -06:00
Jack Nagel
aed70e50e8 Add tests for ARGV.filter_for_dependencies 2013-01-22 13:57:13 -06:00
Jack Nagel
2bacf38833 Add tests for ENV.with_build_environment 2013-01-22 13:57:07 -06:00
Mike McQuaid
2c7ac3c244 CONTRIBUTING: actually fix this time. 2013-01-22 09:47:37 +00:00
Rory O’Kane
7a685856c5 CONTRIBUTING: fix link to Acceptable Formulae.
To match the recent renaming of that wiki article.

Closes Homebrew/homebrew#17249.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-22 08:54:07 +00:00
Jack Nagel
a03bbf5797 Use new requirement syntax 2013-01-21 17:36:34 -06:00
Jack Nagel
452e79cf68 Allow satisfied? to be specified in a block
Instead of overriding #satisfied?, Requirement subclasses can specify
the condition in a block:

  satisfy do
    some_condition?
  end

The contents of the block are evaluated in the context of the instance,
and so have access to instance variables and instance methods as before.
Additionally, it is wrapped in an ENV.with_build_environment block. This
can be disabled by passing :build_env => false to satisfy:

  satisfy :build_env => false do
    some_condition?
  end
2013-01-21 17:24:12 -06:00
Jack Nagel
09d4a7fb36 Block-style env DSL examples 2013-01-21 17:24:11 -06:00
Jack Nagel
2503cedf2c Object#instance_exec for Ruby 1.8.6
Not thread safe! But I don't think we care.

We want to evaluate the env DSL block in the context of ENV for asthetic
reasons, but we also want access to methods on the requirement instance.
We can use #instance_exec to pass the requirement itself into the block:

  class Foo < Requirement
    env do |req|
      append 'PATH', req.some_path
    end

    def some_path
      which 'something'
    end
  end

Also add a simplified version of Object#instance_exec for Ruby 1.8.6.
2013-01-21 17:24:11 -06:00
Jack Nagel
c53af42117 Allow env DSL to take a block
In addition to

  env :userpaths
  env :std

requirements can now do

  env do
    append 'PATH', '/some/path/to/bin'
    # and more
  end
2013-01-21 17:24:10 -06:00
Jack Nagel
d06824c357 ENV.with_build_environment 2013-01-21 17:24:10 -06:00
Jack Nagel
3d92f1c683 build: reorganize #install for readability 2013-01-21 17:14:16 -06:00
Jack Nagel
1f505af566 tests: add mocha mocking library 2013-01-21 17:14:16 -06:00
Matt Di Pasquale
e9158ca6dc brew upgrade: improve exit codes.
exit 1 if formulae given but none outdated

Closes Homebrew/homebrew#17199.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-21 19:55:09 +00:00
Jack Nagel
d4dc1bbd15 superenv: favor /opt/X11 over /usr/X11 when both exist
This is the order of precedence used elsewhere in Homebrew when
detecting X11 versions and prefixes.

Fixes Homebrew/homebrew#16598.
2013-01-20 19:46:01 -06:00
Misty De Meo
7f9fbe2636 Document HOMEBREW_NO_EMOJI in manpage 2013-01-19 17:29:09 -06:00
Randy Thiemann
766bc13cfb Allow hiding Homebrew emoji with an env var.
Closes Homebrew/homebrew#17085.
Closes Homebrew/homebrew#17086.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-01-19 23:13:01 +00:00