various: Homebrew/core is the core tap

Also make `Homebrew/homebrew` as an alias of this tap to keep
backward compatibility.
This commit is contained in:
Xu Cheng 2016-03-06 14:50:33 +08:00
parent c5132daf63
commit a5cfc011e0
6 changed files with 8 additions and 10 deletions

View File

@ -38,7 +38,6 @@ module Homebrew
if ARGV.named.empty? if ARGV.named.empty?
formulae = Formula.files formulae = Formula.files
alias_dirs = Tap.map(&:alias_dir) alias_dirs = Tap.map(&:alias_dir)
alias_dirs.unshift CoreTap.instance.alias_dir
else else
tap = Tap.fetch(ARGV.named.first) tap = Tap.fetch(ARGV.named.first)
raise TapUnavailableError, tap.name unless tap.installed? raise TapUnavailableError, tap.name unless tap.installed?

View File

@ -10,8 +10,6 @@ module Homebrew
end end
end end
raise "#{tap} is not allowed" if taps.any?(&:core_tap?)
if ARGV.json == "v1" if ARGV.json == "v1"
print_tap_json(taps) print_tap_json(taps)
else else

View File

@ -1073,13 +1073,13 @@ class Formula
# an array of all tap {Formula} names # an array of all tap {Formula} names
# @private # @private
def self.tap_names def self.tap_names
@tap_names ||= Tap.flat_map(&:formula_names).sort @tap_names ||= Tap.reject(&:core_tap?).flat_map(&:formula_names).sort
end end
# an array of all tap {Formula} files # an array of all tap {Formula} files
# @private # @private
def self.tap_files def self.tap_files
@tap_files ||= Tap.flat_map(&:formula_files) @tap_files ||= Tap.reject(&:core_tap?).flat_map(&:formula_files)
end end
# an array of all {Formula} names # an array of all {Formula} names
@ -1152,7 +1152,7 @@ class Formula
# an array of all tap aliases # an array of all tap aliases
# @private # @private
def self.tap_aliases def self.tap_aliases
@tap_aliases ||= Tap.flat_map(&:aliases).sort @tap_aliases ||= Tap.reject(&:core_tap?).flat_map(&:aliases).sort
end end
# an array of all aliases # an array of all aliases

View File

@ -344,7 +344,7 @@ class Formulary
if core_path(ref).file? if core_path(ref).file?
opoo <<-EOS.undent opoo <<-EOS.undent
#{ref} is provided by core, but is now shadowed by #{selected_formula.full_name}. #{ref} is provided by core, but is now shadowed by #{selected_formula.full_name}.
To refer to the core formula, use Homebrew/homebrew/#{ref} instead. To refer to the core formula, use Homebrew/core/#{ref} instead.
EOS EOS
end end
selected_formula selected_formula

View File

@ -52,8 +52,9 @@ class Tab < OpenStruct
attributes["source"]["tap"] = attributes.delete("tapped_from") attributes["source"]["tap"] = attributes.delete("tapped_from")
end end
if attributes["source"]["tap"] == "mxcl/master" if attributes["source"]["tap"] == "mxcl/master" ||
attributes["source"]["tap"] = "Homebrew/homebrew" attributes["source"]["tap"] == "Homebrew/homebrew"
attributes["source"]["tap"] = "homebrew/core"
end end
if attributes["source"]["spec"].nil? if attributes["source"]["spec"].nil?

View File

@ -30,7 +30,7 @@ class Tap
user = "Homebrew" if user == "homebrew" user = "Homebrew" if user == "homebrew"
repo = repo.strip_prefix "homebrew-" repo = repo.strip_prefix "homebrew-"
if user == "Homebrew" && repo == "homebrew" if user == "Homebrew" && (repo == "homebrew" || repo == "core")
return CoreTap.instance return CoreTap.instance
end end