2249 Commits

Author SHA1 Message Date
Mike McQuaid
6400f41a77 Fix keg-only on pre-Mountain Lion formulae. 2012-08-23 09:49:08 -07:00
Adam Vandenberg
7b66291cc6 audit: be a bit more lenient 2012-08-22 21:31:38 -07:00
Adam Vandenberg
0654753695 audit: allow certain ARGV usages 2012-08-22 21:10:26 -07:00
Adam Vandenberg
2566ec85cb audit: complain until we use option and build 2012-08-22 20:59:43 -07:00
Mike McQuaid
1f8af42fee 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 Homebrew/homebrew#14325.
2012-08-22 13:34:26 -07:00
Adam Vandenberg
97d1dc4f2b Cache found svn binary 2012-08-22 09:44:49 -07:00
Adam Vandenberg
b104623f43 Honor GIT env var 2012-08-22 09:43:30 -07:00
Jack Nagel
5e0cbdab9b 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 Homebrew/homebrew#14342.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-21 15:55:20 -05:00
Jack Nagel
98b6f24510 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
e2058ed362 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
abf55c2bcd Support ENV[VERBOSE] 2012-08-21 12:09:07 -04:00
Max Howell
ebb894073d brew irb uses correct Ruby
Conversation here: 0a45d96b21a5056e5131f136e94533a6a57bf808
2012-08-21 12:09:07 -04:00
Max Howell
ee11f32fb7 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
4e7bb6c637 Better message if multiple kegs need linking 2012-08-21 12:09:05 -04:00
Max Howell
9274f7cda1 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
c5266654ff In fact, there are 2 xcode-select files to delete 2012-08-21 12:09:04 -04:00
Jack Nagel
8a9a1d5b00 Simplify MacOS.locate
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-20 15:00:32 -05:00
Jack Nagel
f471c3e99f 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
3f9e88ae69 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
9b1bb58214 HOMEBREW_CONTRIB
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-20 13:57:01 -05:00
Jack Nagel
35e32f352d 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
c6b3cd7cf4 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
93f7a0fa85 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 Homebrew/homebrew#11863.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel
8a21bd52d5 Add ARGV.ignore_deps?
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 19:33:39 -05:00
Jack Nagel
3081e69783 Test version interrogation methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:07:14 -05:00
Jack Nagel
23cc14f9a1 Simplify version comparison tests
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 16:03:43 -05:00
Jack Nagel
c924de7086 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
a81da08732 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
d95f467362 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
166a9ba0ed Deprecate MacOS.version? style methods
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:25:59 -05:00
Jack Nagel
b8231fc5f3 Add custom comparator for MacOS.version
This will allow us to do comparisons like

  if MacOS.version >= :lion

and hopefully deprecate the MacOS.<name>? family of methods, which are
counterinitutive.
2012-08-18 11:13:54 -05:00
Jack Nagel
158b7047e5 Add small DSL for defining comparators 2012-08-18 11:12:10 -05:00
Jack Nagel
93baea7e47 outdated: use new version comparison machinery 2012-08-18 11:12:10 -05:00
Jack Nagel
31b61cb013 keg: add method to return the corresponding Version 2012-08-18 11:12:10 -05:00
Jack Nagel
2ff6c40735 Add support for custom version schemes
A version scheme is a class that inherits from Version and reimplements
Version#<=>. This will allow formulae to specify a custom comparison
method that will be used instead of the default, for cases where the
default is insufficient.
2012-08-18 11:12:09 -05:00
Jack Nagel
741a4168d0 SoftwareSpec: simplify conditional 2012-08-18 11:12:09 -05:00
Jack Nagel
e57122780e Add Version#detected_from_url? 2012-08-18 11:12:09 -05:00
Jack Nagel
329f0a8490 Replace version strings with Version objects 2012-08-18 11:12:08 -05:00
Jack Nagel
43dc54e8b9 Further version test refactoring 2012-08-18 11:12:08 -05:00
Jack Nagel
5fe7fdf153 Move version detection to Version class
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Jack Nagel
956c1d653a Initial version comparison implementation
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-18 11:12:07 -05:00
Jack Nagel
969ce2f67d Preliminary version test refactoring 2012-08-18 11:12:07 -05:00
Jack Nagel
104fc0e09b Add Version class 2012-08-18 11:12:07 -05:00
Jack Nagel
1a8d535721 Add Xcode 4.4.1 to standard compilers map
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-17 22:38:32 -05:00
Jack Nagel
b3724b2945 Remove executable bits from audit.rb and bottle.rb
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-17 21:09:12 -05:00
Max Howell
ad02ea74da Fix syntax error, sorry about that.
Didn't test properly, it was a side-fix. Bad mxcl.
2012-08-17 18:00:33 -04:00
Max Howell
6ffe27fa98 Stop warning about CLT w/o Xcode
Also made the latest_versions checks smarter. Hopefully correct too.
2012-08-17 17:18:17 -04:00
Adam Vandenberg
4a948c4132 Add special :xcode dependency
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-17 15:35:54 -05:00
Jack Nagel
ac51c0ffbb Increment copyright year in LICENSE
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-17 13:38:26 -05:00
Jack Nagel
83cdc64b40 FormulaInstaller: filter ARGV when testing for installed deps
In FormulaInstaller#install, needed_deps is created without first
filtering ARGV for flags like --HEAD. In practice, this means that
sometimes needed_deps will contain dependencies that are actually
already installed; --HEAD causes Formula#installed_prefix to differ and
thus checking Formula#installed? will result in false negatives.

This can trigger weird bugs; for example, Homebrew/homebrew#10380, where the "Installing
foo" header is displayed even though no dependencies were previously
installed.

Fix this by filtering ARGV before testing for installed dependencies,
and do the same for requirements to maintain symmetry, and because some
requiremnts check Formula#installed? as well.

Fixes Homebrew/homebrew#10380.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-08-15 22:39:52 -05:00