aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2016-02-26 17:39:49 +0800
committerXu Cheng2016-04-02 21:51:36 +0800
commit56cb3325a6404602266539c4203fa32a9dd6ae13 (patch)
tree76ef0ae8500a7bed99e1b0a52849746fc3fb0bef /Library
parenta5cfc011e01f6a57f9251ee6dc88f706d2af79ed (diff)
downloadbrew-56cb3325a6404602266539c4203fa32a9dd6ae13.tar.bz2
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`.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/prune.rb2
-rw-r--r--Library/Homebrew/cmd/tap.rb9
-rw-r--r--Library/Homebrew/cmd/update-report.rb13
3 files changed, 10 insertions, 14 deletions
diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb
index 0ad9f23e6..9631f1f81 100644
--- a/Library/Homebrew/cmd/prune.rb
+++ b/Library/Homebrew/cmd/prune.rb
@@ -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
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb
index 99efc7aab..079365336 100644
--- a/Library/Homebrew/cmd/tap.rb
+++ b/Library/Homebrew/cmd/tap.rb
@@ -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
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb
index d85b35cec..ed9dc6fbf 100644
--- a/Library/Homebrew/cmd/update-report.rb
+++ b/Library/Homebrew/cmd/update-report.rb
@@ -1,4 +1,3 @@
-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