Commit Graph
15 Commits
Author SHA1 Message Date
Jack Nagel eec09f63d2 Add Requirement#inspect 2013-06-07 22:24:36 -05:00
Jack Nagel 0759cce3c2 Extract attr_rw from Formula for reuse
Closes #20239.
2013-06-04 11:06:18 -05:00
Jack Nagel b2972dc1f9 Allow explicit conversion of requirements to deps
Fixes #19857.
2013-06-03 16:52:00 -05:00
Jack Nagel 17bf43ef70 Refactor Requirement.expand 2013-06-03 16:47:27 -05:00
Jack Nagel 2609349cbe Requirement: fix typo 2013-06-02 17:14:42 -05:00
Mike McQuaid 2d9329f14e Allow requirements to specify a default formula.
This allows default resolution of requirements without user intervention.

Closes #19627.
2013-05-10 13:37:41 +01:00
Jack Nagel 62389cc274 Reduce allocations in dependency construction
By always passing around a single, unnested array rather than splatting
and then defensively flattening and compacting things, we can avoid
allocating a bunch of unnecessary arrays. This gives a performance boost
of roughly 4% when enumerating 2500 formulae, and has the side effect of
cleaning up the dependency API.
2013-05-06 16:08:50 -05:00
Jack Nagel d839567f1f Requirement: env DSL is evaluated in context of self, not ENV
This was meant to support:

  env do |req|
    append_path 'PATH', req.some_method
    ...
  end

i.e., the block was evaluated in the context of ENV. But it turned out
to be not so useful after all, so I'm ripping it out before something
actually depends on it.
2013-04-01 16:17:35 -05:00
Jack Nagel 15b49bc388 Simplify this regexp 2013-02-12 16:28:50 -06:00
Jack Nagel c4db67fc9b Establish a convention for Requirement names
The name attribute of requirements is used when generating options for
the :optional and :recommended dependency tags.

Unless otherwise specified, the name attribute of a Requirement will be
populated by stripping any module prefixes from the beginning and
"Dependency" or "Requirement" from end of the class name and downcasing
the result.

Closes #17759.
2013-02-12 16:26:10 -06:00
Jack Nagel a1aea154a8 Fix typo 2013-02-07 18:58:26 -06:00
Jack Nagel 7522e4883b Proper recursive expansion of requirements with filtering
Expand requirements recursively while applying the same optional? and
recommended? filters that dependencies are run through. Options
generated by requirements are now checked against the correct list of
requirements, eliminating the temporary "best guess" logic in the
installer.
2013-01-31 15:40:06 -06:00
Jack Nagel 8df3f14d15 Create proxy classes for "partial" X11 dependencies
When a formula's dependency tree contains more than one X11 dependency,
they are de-duplicated by comparing the min_version attribute. However,
this can result in broken dependency trees if one of the X11Dependency
objects was actually specified as e.g. `:libpng`.

In practice, this only matters when one or more of the dependencies has
additional metadata that makes it distinct from the rest, i.e. an
:optional or :recommended tag.

To combat this, make these special, "partial" X11 dependencies instances
of different classes so that they are not de-duped.

It will still be necessary, at the time when requirements are expanded
by the installer, to de-duplicate any remaining X11 dependencies after
applying the optional/recommended filters in order to avoid duplicated
modifications to the environment (as ENV.x11 is not idempotent).

c.f. #17369.
2013-01-31 15:39:26 -06:00
Jack Nagel ca134adfbb Allow specifying a name attribute for X11Dependency 2013-01-28 10:35:14 -06:00
Jack Nagel bf1ce53366 Split dependency classes into separate files 2013-01-26 20:30:05 -06:00