aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-08-08 09:31:49 +0100
committerMike McQuaid2016-08-08 10:54:48 +0100
commit3847db6026bc025bb7567a1b00d6428e276c297b (patch)
tree4642be7a4ecc170af173a61259da62ce197e7554
parentc9fabf57a5cd4cb0597d7cdbcd2a41ef17747a87 (diff)
downloadbrew-3847db6026bc025bb7567a1b00d6428e276c297b.tar.bz2
formula_installer: better handle missing conflict.
Doesn't feel like a good reason to abort installation for users if the formula author has specified a conflict that doesn't exist. Instead, behave more like the `TapFormulaUnavailableError` but print a message telling people to report to the formula authors. Closes https://github.com/Homebrew/homebrew-versions/issues/1327
-rw-r--r--Library/Homebrew/formula_installer.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index eb98d8063..d8d1a8fbf 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -251,10 +251,23 @@ class FormulaInstaller
begin
f = Formulary.factory(c.name)
rescue TapFormulaUnavailableError
- # If the formula name is in full-qualified name. Let's silently
+ # If the formula name is a fully-qualified name let's silently
# ignore it as we don't care about things used in taps that aren't
# currently tapped.
false
+ rescue FormulaUnavailableError => e
+ # If the formula name doesn't exist any more then complain but don't
+ # stop installation from continuing.
+ opoo <<-EOS.undent
+ #{formula}: #{e.message}
+ 'conflicts_with \"#{c.name}\"' should be removed from #{formula.path.basename}.
+ EOS
+ if ARGV.homebrew_developer?
+ raise
+ else
+ $stderr.puts "Please report this to the #{formula.tap} tap!"
+ end
+ false
else
f.linked_keg.exist? && f.opt_prefix.exist?
end