aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dependency.rb
diff options
context:
space:
mode:
authorJack Nagel2013-11-13 10:38:14 -0600
committerJack Nagel2013-11-13 10:38:14 -0600
commit2fb5ead38a7632ff6f941909474767883a9e0252 (patch)
treea0d68b8b81609b978e494b75973f8d4cd0668622 /Library/Homebrew/dependency.rb
parentc137f030bce74646416099e2c459ded6072e6c4f (diff)
downloadbrew-2fb5ead38a7632ff6f941909474767883a9e0252.tar.bz2
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.
Diffstat (limited to 'Library/Homebrew/dependency.rb')
-rw-r--r--Library/Homebrew/dependency.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb
index df22eed90..fda491b99 100644
--- a/Library/Homebrew/dependency.rb
+++ b/Library/Homebrew/dependency.rb
@@ -82,6 +82,8 @@ class Dependency
next []
when :skip
expand(dep.to_formula, &block)
+ when :keep_but_prune_recursive_deps
+ [dep]
else
expand(dep.to_formula, &block) << dep
end
@@ -110,6 +112,11 @@ class Dependency
throw(:action, :skip)
end
+ # Keep a dependency, but prune its dependencies
+ def keep_but_prune_recursive_deps
+ throw(:action, :keep_but_prune_recursive_deps)
+ end
+
def merge_repeats(deps)
grouped = deps.group_by(&:name)