brew tap --repair
Removes dead symlinks in Formula and re-symlinks all Taps. Closes Homebrew/homebrew#11565.
This commit is contained in:
parent
e8c9a19f65
commit
28bbced64b
@ -6,6 +6,8 @@ module Homebrew extend self
|
|||||||
tapd.children.each do |tap|
|
tapd.children.each do |tap|
|
||||||
puts tap.basename.sub('-', '/') if (tap/'.git').directory?
|
puts tap.basename.sub('-', '/') if (tap/'.git').directory?
|
||||||
end if tapd.directory?
|
end if tapd.directory?
|
||||||
|
elsif ARGV.first == "--repair"
|
||||||
|
repair_taps
|
||||||
else
|
else
|
||||||
install_tap(*tap_args)
|
install_tap(*tap_args)
|
||||||
end
|
end
|
||||||
@ -58,6 +60,28 @@ module Homebrew extend self
|
|||||||
tapped
|
tapped
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def repair_taps
|
||||||
|
count = 0
|
||||||
|
# prune dead symlinks in Formula
|
||||||
|
Dir["#{HOMEBREW_REPOSITORY}/Library/Formula/*.rb"].each do |fn|
|
||||||
|
if not File.exist? fn
|
||||||
|
File.delete fn
|
||||||
|
count += 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
puts "Pruned #{count} dead formula"
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
# check symlinks are all set in each tap
|
||||||
|
HOMEBREW_REPOSITORY.join("Library/Taps").children.each do |tap|
|
||||||
|
files = []
|
||||||
|
tap.find_formula{ |file| files << tap.basename.join(file) }
|
||||||
|
count += link_tap_formula(files)
|
||||||
|
end
|
||||||
|
|
||||||
|
puts "Tapped #{count} formula"
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def tap_args
|
def tap_args
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user