Commit Graph
1919 Commits
Author SHA1 Message Date
Adam Vandenberg 9028fdfb01 Formula factory: add comment 2012-08-26 17:08:09 -07:00
Adam Vandenberg 0597068827 Formula factory: re-raise certain NameErrors.
Some name errors, such as NoMethodError, represent programming errors.
Re-raise them to get a usable error message.

Closes #14467.
2012-08-26 17:06:38 -07:00
Jack Nagel 1be1e61de7 Ask the user for help if MacOS.compilers_standard? fails
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-26 13:57:23 -05:00
Adam Vandenberg d0656a938b create: allow --set-name and --set-version
Closes #10873.
Closes #14401.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-08-26 08:39:36 -07:00
samueljohn 379b0960b1 formula_installer: make "linking" more clear
When building software "linking step did not complete" sounds
like ld failed. Let's be clear about this.

Closes #14407.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-08-25 15:36:13 -07:00
Jack Nagel efaec17212 tests: adjust test_bottle_spec_selection for new bottle code
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-25 16:03:35 -05:00
Mike McQuaid 43292793ee Don't fail to cleanup redacted formula. 2012-08-25 13:40:05 -07:00
Mike McQuaid 18fb888ff3 Miscellaneous bottle code cleanup. 2012-08-25 13:08:46 -07:00
Mike McQuaid f9268c81fe Check formula options properly to rule out bottle.
Fixes #14148.
2012-08-25 11:52:37 -07:00
Mike McQuaid 0d1c1491c4 Fix ARGV and bottles circular dependency. 2012-08-25 11:52:37 -07:00
Mike McQuaid 8837423a5a Rename tab 'built_bottle' to 'build_as_bottle'. 2012-08-25 11:52:37 -07:00
Mike McQuaid 1b7056346b Move used_options and unused_options to ARGV. 2012-08-25 11:52:37 -07:00
Mike McQuaid 7dc7c38324 Fix tests and NoMethodError with no X11 installed. 2012-08-25 10:21:48 -07:00
Mike McQuaid 580180bffe erlang: fix version detection and bottles. 2012-08-25 10:21:48 -07:00
Adam Vandenberg f1d227d153 audit checks for passing dashes to build.include? 2012-08-25 09:37:41 -07:00
Charlie Sharpsteen f447619b0e XCodeDependency: Clarify that Xcode.app is needed
Clarify the error message arising from XCodeDependency so that users know
XCode.app is needed and that just installing the CLT does not count as
"installing XCode".
2012-08-24 19:38:03 -07:00
Jack Nagel 84a084a083 Compact whitespace when removing flags
This prevents multiple calls to flag-modifying ENV methods from
resulting in large amounts of consecutive spaces.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 22:29:56 -05:00
Jack Nagel 672696b086 Version: make MacOSVersion comparison more robust
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:16:08 -05:00
Jack Nagel 101c418272 factory: always check const_defined? before requiring
Specifying dependencies with a URL works, even if by accident, but
factory is called repeatedly on this URL and this results in multiple
downloads of the same file.

Fix this by checking const_defined? here too, and DRY up the code a bit.

Fixes #14285.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 18:13:54 -05:00
samueljohn 17469d7ad6 Xcode-only: Clean up compiler flags. Use CPATH.
- When using CPATH, we only need -isysroot and not the other -I spam.
- LDFLAGS use -isysroot instead of -L
  Turns out that the linker also understands the
  -isysroot flag which behaves more natural (in the
  sense: "like the internal defaults `/usr/lib` etc.)
  than adding `-L$(SDKROOT).
  Especially for duplicates, the linker first searches
  through all `-L` dirs and then looks at the sysroot
  or internal defaults. This is what we want.
- Pkg-config needs CC with CFLAGS passed to configure.

Closes #14351.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-23 16:26:28 -05:00
Mike McQuaid b946bf758a Fix keg-only on pre-Mountain Lion formulae. 2012-08-23 09:49:08 -07:00
Adam Vandenberg 573c73e9af audit: be a bit more lenient 2012-08-22 21:31:38 -07:00
Adam Vandenberg b8f8ded09e audit: allow certain ARGV usages 2012-08-22 21:10:26 -07:00
Adam Vandenberg 805689b6b3 audit: complain until we use option and build 2012-08-22 20:59:43 -07:00
Mike McQuaid e6647d3a77 Don't use XQuartz for e.g. :libpng on 10.8.
XQuartz isn't added to the default library paths so if something is
linked against a Homebrew libpng then it doesn't work against the
XQuartz libpng. The CLT provides X11 on Lion so don't request users
install XQuartz if it isn't needed on Mountain Lion.

Fixes #14325.
2012-08-22 13:34:26 -07:00
Adam Vandenberg 0948b550bc Cache found svn binary 2012-08-22 09:44:49 -07:00
Adam Vandenberg add682df72 Honor GIT env var 2012-08-22 09:43:30 -07:00
Jack Nagel 4a36c56ac7 factory: rescue NameError
Due to the new const_defined? checks, passing certain names (such as
those that start with a digit) that are illegal constant names will
raise NameError. Catch this and error out gracefully, as we would have
previously.

Fixes #14342.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-21 15:55:20 -05:00
Jack Nagel e6b0de7c7d keg_fix_install_names doesn't need Find
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-21 14:23:25 -05:00
Jack Nagel 8af25edcf8 mach-o: use any? instead of map and include?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-21 13:45:35 -05:00
Max Howell d4f034d552 Support ENV[VERBOSE] 2012-08-21 12:09:07 -04:00
Max Howell a96057994b brew irb uses correct Ruby
Conversation here: 0a45d96b21
2012-08-21 12:09:07 -04:00
Max Howell 188b1596a6 conflicts_with message: recommend unlink
Yes uninstall works, but lets not push people towards that, they can presumably guess that, in the rare case they'd prefer that option.
2012-08-21 12:09:06 -04:00
Max Howell c5552506c8 Better message if multiple kegs need linking 2012-08-21 12:09:05 -04:00
Max Howell a9e43d65a1 Formula.Enumerable
Deprecated Formula.all, replaced usage with more appropriate enumerable options. Just check out how much nicer `brew audit` runs now.
2012-08-21 12:09:05 -04:00
Max Howell 0fc9b210fe In fact, there are 2 xcode-select files to delete 2012-08-21 12:09:04 -04:00
Jack Nagel 6c444e05e3 Simplify MacOS.locate
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-20 15:00:32 -05:00
Jack Nagel 94f61e599b MacOS.dev_tools_path: return nil if not found
This matches the semantics of other path methods, such as Xcode.prefix.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-20 15:00:32 -05:00
Jack Nagel 803535556c Simplify build options API
Simplify access to the different forms of a formula's build options by
making options into real objects rather than strings, and expose both
the 'name' and 'flag' form.
2012-08-20 14:16:08 -05:00
Jack Nagel a5364708ca HOMEBREW_CONTRIB
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-20 13:57:01 -05:00
Jack Nagel bbc167b9e7 factory: don't reload previously defined formulae
build.rb calls Formula.factory to get a usable Formula object to pass to
its install method. However, because the formula file is the actual
executing script, its class is already defined, and loading it again
causes the class to be re-evaluated, which, unfortunately, is not
idempotent.

This bug has existed for a very long time, and its side effects include
duplicate entries the deps array and mirrors array, among others.
Fortunately, the fix is very simple.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-19 12:04:44 -05:00
Jack Nagel 9526817341 Don't lie about upgrading up-to-date formulae
Usually, the "foo-version already installed" error is printed by
FormulaInstaller. However, if an up-to-date formula that has outdated
deps is passed on the command line, we proceed to upgrade the deps and
then print a message saying that the formulae given on the command line
is already installed.

Catch this earlier, when the outdated list is being populated, print an
appropriate message, and skip the up-to-date formula.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel 07d6ace2f2 upgrade: filter ARGV when expanding deps
This serves the same purpose as similar code in FormulaInstaller, but we
duplicate it because we do the dependency expansion in an ad-hoc fashion
here.

Fixes #11863.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel ec5770b590 Add ARGV.ignore_deps?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel ca24ee0ef2 Test version interrogation methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:07:14 -05:00
Jack Nagel 74c58497bd Simplify version comparison tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:03:43 -05:00
Jack Nagel 6ccf2aa253 Version: build-in devel version comparisons
The heuristic used by the default version comparison is simple. A
version string is scanned for strings of digits, split into an array of
these strings, and then an element-wise comparison is done.

This fails when presented with something like

  Version.new("1.0.0beta7") <=> Version.new("1.0.0")

because the first three digits match, and the fourth digit of the
receiver (7) is greater than the assumed fourth digit of the parameter
(0).

Fix this by defining an element-wise comparator on a new VersionElement
class. This allows us to correctly compare "alpha", "beta", and "rc"
style version strings, and keeps the logic out of the main version
comparison.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 15:53:04 -05:00
Jack Nagel a17eaca132 Refer to the real keg when dying because the keg exists
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:26:00 -05:00
Jack Nagel 094ce49859 Refactor brew missing
The heuristic for determining whether something is installed changes
from "f.installed?" to "f.rack.exist? and f.rack.subdirs.length > 0" in
order to properly consider outdated formulae.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:25:59 -05:00
Jack Nagel ce604c642d Deprecate MacOS.version? style methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:25:59 -05:00