link: tell users of brew link --force about opt.
If people are force-linking keg-only things they should probably be told that they can add the opt prefix to their PATH instead.
This commit is contained in:
parent
08a22d013e
commit
4cae6a724e
@ -44,6 +44,7 @@ module Homebrew
|
||||
elsif keg_only && !ARGV.force?
|
||||
opoo "#{keg.name} is keg-only and must be linked with --force"
|
||||
puts "Note that doing so can interfere with building software."
|
||||
puts_keg_only_path_message(keg)
|
||||
next
|
||||
elsif mode.dry_run && mode.overwrite
|
||||
puts "Would remove:"
|
||||
@ -53,6 +54,7 @@ module Homebrew
|
||||
elsif mode.dry_run
|
||||
puts "Would link:"
|
||||
keg.link(mode)
|
||||
puts_keg_only_path_message(keg) if keg_only
|
||||
|
||||
next
|
||||
end
|
||||
@ -69,10 +71,25 @@ module Homebrew
|
||||
else
|
||||
puts "#{n} symlinks created"
|
||||
end
|
||||
|
||||
if keg_only && !ARGV.homebrew_developer?
|
||||
puts_keg_only_path_message(keg)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def puts_keg_only_path_message(keg)
|
||||
bin = keg/"bin"
|
||||
sbin = keg/"sbin"
|
||||
return if !bin.directory? && !sbin.directory?
|
||||
|
||||
opt = HOMEBREW_PREFIX/"opt/#{keg.name}"
|
||||
puts "\nIf you need to have this software first in your PATH instead consider running:"
|
||||
puts " #{Utils::Shell.prepend_path_in_shell_profile(opt)}/bin" if bin.directory?
|
||||
puts " #{Utils::Shell.prepend_path_in_shell_profile(opt)}/sbin" if sbin.directory?
|
||||
end
|
||||
|
||||
def keg_only?(rack)
|
||||
Formulary.from_rack(rack).keg_only?
|
||||
rescue FormulaUnavailableError, TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user