Skip to content
Snippets Groups Projects
Commit 68a5b1fe authored by CNA-Bld's avatar CNA-Bld Committed by Xu Cheng
Browse files

add fully qualified name for core formulae

parent 0c774cff
No related branches found
No related tags found
No related merge requests found
......@@ -14,8 +14,8 @@ module Homebrew
end
ARGV.named.each do |name|
if !File.exist?(name) && (name =~ HOMEBREW_TAP_FORMULA_REGEX \
|| name =~ HOMEBREW_CASK_TAP_FORMULA_REGEX)
if !File.exist?(name) && (name !~ HOMEBREW_CORE_FORMULA_REGEX) \
&& (name =~ HOMEBREW_TAP_FORMULA_REGEX || name =~ HOMEBREW_CASK_TAP_FORMULA_REGEX)
install_tap $1, $2
end
end unless ARGV.force?
......
......@@ -211,6 +211,8 @@ class Formulary
return FromUrlLoader.new(ref)
when Pathname::BOTTLE_EXTNAME_RX
return BottleLoader.new(ref)
when HOMEBREW_CORE_FORMULA_REGEX
return FormulaLoader.new($1, core_path($1))
when HOMEBREW_TAP_FORMULA_REGEX
return TapLoader.new(ref)
end
......
......@@ -2,6 +2,8 @@
HOMEBREW_TAP_ARGS_REGEX = %r{^([\w-]+)/(homebrew-)?([\w-]+)$}
# match taps' formulae, e.g. someuser/sometap/someformula
HOMEBREW_TAP_FORMULA_REGEX = %r{^([\w-]+)/([\w-]+)/([\w+-.]+)$}
# match core's formulae, e.g. homebrew/homebrew/someformula
HOMEBREW_CORE_FORMULA_REGEX = %r{^homebrew/homebrew/([\w+-.]+)$}i
# match taps' directory paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap
HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY.to_s)}/Taps/([\w-]+)/([\w-]+)}
# match taps' formula paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula
......
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