Leave kegs keg-only if linking step fails
Rationale: well, it should always have been like this! However now we are opening ourselves up to more-mixed installations of formula not maintained by us, it's important that
This commit is contained in:
parent
921f0e5674
commit
765ae96180
@ -11,12 +11,7 @@ module Homebrew extend self
|
|||||||
ARGV.kegs.each do |keg|
|
ARGV.kegs.each do |keg|
|
||||||
print "Linking #{keg}... "
|
print "Linking #{keg}... "
|
||||||
puts if ARGV.verbose?
|
puts if ARGV.verbose?
|
||||||
begin
|
puts "#{keg.link} symlinks created"
|
||||||
puts "#{keg.link} symlinks created"
|
|
||||||
rescue Exception
|
|
||||||
puts
|
|
||||||
raise
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -273,15 +273,10 @@ class Pathname
|
|||||||
|
|
||||||
self.dirname.mkpath
|
self.dirname.mkpath
|
||||||
Dir.chdir self.dirname do
|
Dir.chdir self.dirname do
|
||||||
# TODO use Ruby function so we get exceptions
|
# NOTE only system ln -s will create RELATIVE symlinks
|
||||||
# NOTE Ruby functions may work, but I had a lot of problems
|
system 'ln', '-s', src.relative_path_from(self.dirname), self.basename
|
||||||
rv = system 'ln', '-sf', src.relative_path_from(self.dirname), self.basename
|
# ln outputs useful error message for us
|
||||||
unless rv and $? == 0
|
raise "Could not create symlink: #{to_s}." unless $?.success?
|
||||||
raise <<-EOS.undent
|
|
||||||
Could not create symlink #{to_s}.
|
|
||||||
Check that you have permissions on #{self.dirname}
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -214,11 +214,14 @@ class FormulaInstaller
|
|||||||
f.linked_keg.unlink
|
f.linked_keg.unlink
|
||||||
end
|
end
|
||||||
|
|
||||||
Keg.new(f.prefix).link
|
keg = Keg.new(f.prefix)
|
||||||
|
keg.link
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
onoe "The linking step did not complete successfully"
|
onoe "The linking step did not complete successfully"
|
||||||
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
|
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
|
||||||
puts "You can try again using `brew link #{f.name}'"
|
puts "You can try again using `brew link #{f.name}'"
|
||||||
|
keg.unlink
|
||||||
|
|
||||||
ohai e, e.backtrace if ARGV.debug?
|
ohai e, e.backtrace if ARGV.debug?
|
||||||
@show_summary_heading = true
|
@show_summary_heading = true
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user