Skip to content
Snippets Groups Projects
Commit 56cb3325 authored by Xu Cheng's avatar Xu Cheng
Browse files

remove migrate_taps

We don't need to migrate the tapped formulae from symlink-based to
directory-based structure any more.

Instead, we add core tap install check for `brew update-report` which
will be invoked by `brew update`.
parent a5cfc011
No related branches found
No related tags found
No related merge requests found
......@@ -37,8 +37,6 @@ module Homebrew
end
end
migrate_taps :force => true unless ARGV.dry_run?
if ObserverPathnameExtension.total.zero?
puts "Nothing pruned" if ARGV.verbose?
else
......
......@@ -4,7 +4,6 @@ module Homebrew
def tap
if ARGV.include? "--repair"
Tap.each(&:link_manpages)
migrate_taps :force => true
elsif ARGV.include? "--list-official"
require "official_taps"
puts OFFICIAL_TAPS.map { |t| "homebrew/#{t}" }
......@@ -36,12 +35,4 @@ module Homebrew
true
end
end
# Migrate tapped formulae from symlink-based to directory-based structure.
def migrate_taps(options = {})
ignore = HOMEBREW_LIBRARY/"Formula/.gitignore"
return unless ignore.exist? || options.fetch(:force, false)
(HOMEBREW_LIBRARY/"Formula").children.each { |c| c.unlink if c.symlink? }
ignore.unlink if ignore.exist?
end
end
require "cmd/tap"
require "formula_versions"
require "migrator"
require "formulary"
......@@ -6,8 +5,7 @@ require "descriptions"
module Homebrew
def update_report
# migrate to new directories based tap structure
migrate_taps
install_core_tap_if_necessary
hub = ReporterHub.new
......@@ -63,6 +61,15 @@ module Homebrew
def shorten_revision(revision)
Utils.popen_read("git", "-C", HOMEBREW_REPOSITORY, "rev-parse", "--short", revision).chomp
end
def install_core_tap_if_necessary
core_tap = CoreTap.instance
return if core_tap.installed?
CoreTap.ensure_installed! :quiet => false
revision = core_tap.git_head
ENV["HOMEBREW_UPDATE_BEFORE_HOMEBREW_HOMEBREW_CORE"] = revision
ENV["HOMEBREW_UPDATE_AFTER_HOMEBREW_HOMEBREW_CORE"] = revision
end
end
class Reporter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment