Commit Graph
413 Commits
Author SHA1 Message Date
Mike McQuaid 8f7e677456 Update string references to mxcl/homebrew. 2013-12-14 18:18:35 +00:00
Jack Nagel 0cc4da7bed Add HOMEBREW_TEMP to testing environment 2013-12-14 09:47:32 -06:00
Jack Nagel 8a40b00435 Combine superenv tests 2013-12-12 15:42:35 -06:00
Jack Nagel 09235c3d6e Add another fails_with test 2013-12-12 14:53:53 -06:00
Jack Nagel b32702538a Simplify prefix test 2013-12-11 19:18:23 -06:00
Jack Nagel f6df3e46ea Implement hash equality for Version 2013-12-09 19:43:07 -06:00
Jack Nagel 9962f62a48 Extract constants for checkums in tests 2013-12-09 15:57:50 -06:00
Jack Nagel 3b565c39d5 Pass deps collection to be expanded as a parameter 2013-12-09 14:36:10 -06:00
Misty De Meo b95f2357d8 Use BottleCollector in Bottle SoftwareSpec 2013-12-05 18:24:51 -08:00
Misty De Meo b11be1e98b Add BottleCollector
The BottleCollector collects bottle tags and sha1s, and allows tags
to be fetched using more advanced logic than just fetching identical
tags.

Closes #23434.
2013-12-05 18:24:45 -08:00
Misty De Meo 6647e49225 Adjust fails_with syntax for non-Apple compilers
The old version worked like this:

fails_with :gcc => '4.8.1'

That wasn't really flexible enough, and made it harder to distinguish
different releases in the same GCC series. Since no one was really
using it yet, this adjusts the syntax to be more similar to the
Apple compilers:

fails_with :gcc => '4.8' do
  release '4.8.1'
end

Like with Apple compilers, omitting `release` blacklists the entire
series.

This also unifies the `build` and `version` attributes and accessors,
and exposes them under both names.
2013-12-03 22:42:49 -08:00
Jack Nagel 97f0601157 Adjust tests for ac1fd38075 2013-12-03 22:23:14 -06:00
Jack Nagel 334fba8520 Add test for 5c1ee9c1ae 2013-11-26 23:31:53 -06:00
Jack Nagel 8c19edbdd3 Add some missing test cases for brew update 2013-11-14 11:10:43 -06:00
Jack Nagel fdfc54961e Prevent deps of build-time deps from leaking into the build environment
When decided what dependencies should be part of the build environment
(and have appropriate entries added to variables like PKG_CONFIG_PATH),
we select the entire dependency tree except for

 (1) inactive optional and recommended deps (2) indirect build-time deps
 (i.e., build-time deps of other deps)

There is a third category that sould be excluded: dependencies of direct
build-time deps. These are irrelevant to the build, and including them
can cause unexpected linkages.
2013-11-13 10:38:14 -06:00
Jack Nagel 0747d05362 Remove duplicate test 2013-10-31 14:49:23 -05:00
Mike McQuaid 2183cd8d55 Cleanup use of some global constants. 2013-10-30 13:20:48 -07:00
Jack Nagel 4ee541b9e4 Resource: push conditional down into #verify_download_integrity 2013-10-30 10:16:20 -05:00
Jack Nagel 08d52978c2 Disallow initializing Versions with non-strings
Closes #23553.
2013-10-25 17:29:45 -05:00
Jack Nagel 4e6f20272a Stop coercing MACOS_VERSION to a float 2013-10-25 17:29:36 -05:00
Mike McQuaid 57efdbcf69 test_utils: fix Mavericks arch test. 2013-10-23 22:15:28 +01:00
Mike McQuaid 0de5f9e4ff test_formula: add Mavericks bottles. 2013-10-23 22:15:28 +01:00
Mike McQuaid 859b874365 test_formula: use different/consistent SHA-1. 2013-10-23 22:15:28 +01:00
Misty De Meo 2253d50ca2 Bottle tag tests: fix Tiger Intel 64 2013-10-22 13:57:40 -07:00
Jack Nagel fcf616c380 Eagerly initialize formula specs
Declarations of dependencies, options, and resources in the DSL only
apply to specs that have already been initialized. For example, given
this snippet:

  url ...
  sha1 ...

  depends_on 'foo'

  devel do
    url ...
    sha1 ...
  end

The dependency 'foo' will be recorded for the stable spec, but not the
devel spec, since it was not initialized prior to the call to
depends_on.

While it is considered best practice to declare all specs (stable,
devel, head, and bottle) prior to other declarations, there is nothing
that enforces this ordering, so when it happens it can be confusing and
hard to debug.

To prevent this, we can initialize all specs up front. This comes with
a performance penalty for commands that load all formulae into memory,
but that is probably outweighed by what we gain in correctness.

Fixes #23425.
2013-10-22 13:31:08 -05:00
Misty De Meo 57e7f22d99 Fix bottle_tag tests 2013-10-21 18:07:06 -07:00
Jack Nagel 1d0a7c66a5 Add OS.mac? and OS.linux? 2013-10-18 12:56:51 -05:00
Jack Nagel b1434c543a Remove pointless assertion 2013-10-14 21:46:52 -05:00
Jack Nagel 980653027a Assert on state, not something that didn't happen 2013-10-14 21:46:21 -05:00
Jack Nagel 3f32478f4b Resource: do not mutate passed-in specs hash 2013-10-11 20:21:41 -05:00
Jack Nagel 6f8c02ebe2 CurlDownloadStrategy: dup mirror list before mutating it 2013-10-11 19:14:52 -05:00
Mike McQuaid db1bf83184 icu4c: add bottle regex. 2013-10-11 08:40:19 +01:00
Jack Nagel 460ae7f5ab VCSDownloadStrategy: rename checkout_name to cache_filename 2013-10-11 00:21:23 -05:00
Mike McQuaid c1e06c65da git_etc: update based on bottle etc/var changes. 2013-10-10 16:46:47 +01:00
Jack Nagel 0588dea2d3 Extract a new superclass for VCS-based download strategies 2013-10-09 21:41:15 -05:00
Xiyue Deng 122ac08b1f Fix test failure for C++ stdlib. 2013-10-07 03:40:41 -07:00
Misty De Meo 77b678cea9 CxxStdlib: allow for nil stdlibs
A nil stdlib value represents non-C++ code.
2013-10-06 19:26:06 -07:00
Jack Nagel 86e6ff5e80 Check types in Formula#==
Comparing two objects should not raise an exception, even if they have
different types.

The semantics of #== are now the same as #eql?, so make one an alias.
2013-10-04 21:19:15 -05:00
Jack Nagel f1a5f559e3 Handle invalid names in download strategies
When subformulae are initialized without a name parameter, Homebrew
assigns the name "__UNKNOWN__". This may cause collisions in the cache.

Currently CurlDownloadStrategy and its descendants handles this by
extracting the basename form the URL and using that as the cached
filename. However, other strategies simply raise an exception.

We can improve the other strategies by URL-encoding the URL string and
using that as the cached directory name.

Note that this happens very rarely, especially now that resources (which
always have a name) are preferred to subformulae. The most common case
is a subformula that specifies a head download.

Closes #22949.
2013-09-30 22:56:02 -05:00
Jack Nagel a961e1e134 Infer dependencies from download strategies and URLs
Closes #20849.
Closes #22871.
2013-09-28 16:37:05 -05:00
Jack Nagel dd43a9552a Raise when given an invalid download strategy spec
When DownloadStrategyDetector.detect is given a second argument, and
that argument is not a symbol or an AbstractDownloadStrategy subclass,
it is silently ignored, and we fall back to guessing the strategy based
on the URL.

This means I can do

  url 'http://foo.com/bar.tar.gz', :using => Class.new

and things will appear to work, even though I have clearly passed an
invalid value for :using.

A more useful behavior is to raise an exception for unknown strategy
specifications.
2013-09-26 17:00:00 -05:00
Jack Nagel 138b0b177d Set owner of resources to SoftwareSpec object 2013-09-23 21:39:33 -05:00
Jack Nagel 0af7d5611e Move dependencies to SoftwareSpec 2013-09-21 19:27:24 -05:00
Jack Nagel d2c4be9ebe Move options to SoftwareSpec 2013-09-21 19:27:24 -05:00
Jack Nagel 617f2cdb9f Add tests to ensure ENV.compiler is correct 2013-09-20 22:54:07 -05:00
Jack Nagel a2c9d9e2bc At some point this started working again 2013-09-20 15:52:08 -05:00
Jack Nagel e068606c98 Make spec-scoped resources override top-level resources 2013-09-17 21:29:53 -05:00
Jack Nagel 73ddbb6df5 SoftwareSpec tests are now Resource tests 2013-09-17 21:29:50 -05:00
Jack Nagel 8d88a52859 Copies of BuildOptions should not share underlying collections 2013-09-14 17:03:56 -05:00
Jack Nagel 456d8eb2ec Tear down the cache after installation tests 2013-09-14 11:53:32 -05:00