diff options
| author | Vlad Shablinsky | 2016-09-04 00:01:01 +0300 |
|---|---|---|
| committer | Uladzislau Shablinski | 2016-09-07 20:58:09 +0300 |
| commit | a04030a6f77adeb22f18101b527c07ba01d19c77 (patch) | |
| tree | dd02e3b7a5076d880c6dd4f29fd456c367d7cbd3 /Library/Homebrew | |
| parent | efd29ebacaf6352e79c3e3a4c45b9e85c02c8a77 (diff) | |
| download | brew-a04030a6f77adeb22f18101b527c07ba01d19c77.tar.bz2 | |
formula_installer: don't allow pinned dependencies
Prompt user to unpin pinned dependencies of the formula
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index cf595cf71..1e2e8e978 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -146,11 +146,21 @@ class FormulaInstaller raise FormulaInstallationAlreadyAttemptedError, formula if @@attempted.include?(formula) unless skip_deps_check? - unlinked_deps = formula.recursive_dependencies.map(&:to_formula).select do |dep| + recursive_deps = formula.recursive_dependencies + unlinked_deps = recursive_deps.map(&:to_formula).select do |dep| dep.installed? && !dep.keg_only? && !dep.linked_keg.directory? end raise CannotInstallFormulaError, "You must `brew link #{unlinked_deps*" "}` before #{formula.full_name} can be installed" unless unlinked_deps.empty? + + pinned_unsatisfied_deps = recursive_deps.select do |dep| + dep.to_formula.pinned? && !dep.satisfied?(inherited_options_for(dep)) + end + + unless pinned_unsatisfied_deps.empty? + raise CannotInstallFormulaError, + "You must `brew unpin #{pinned_unsatisfied_deps*" "}` as installing #{formula.full_name} requires the latest version of pinned dependencies" + end end end |
