Reorder dep spec types by frequency

This commit is contained in:
Jack Nagel 2013-04-17 14:05:47 -05:00
parent a7714a804b
commit 7ea15918bb

View File

@ -50,16 +50,14 @@ class DependencyCollector
def parse_spec spec, tag def parse_spec spec, tag
case spec case spec
when Symbol
parse_symbol_spec(spec, tag)
when String when String
if tag && LANGUAGE_MODULES.include?(tag) if tag && LANGUAGE_MODULES.include?(tag)
LanguageModuleDependency.new(tag, spec) LanguageModuleDependency.new(tag, spec)
else else
Dependency.new(spec, tag) Dependency.new(spec, tag)
end end
when Formula when Symbol
Dependency.new(spec.name, tag) parse_symbol_spec(spec, tag)
when Dependency, Requirement when Dependency, Requirement
spec spec
when Class when Class
@ -68,6 +66,8 @@ class DependencyCollector
else else
raise "#{spec} is not a Requirement subclass" raise "#{spec} is not a Requirement subclass"
end end
when Formula
Dependency.new(spec.name, tag)
else else
raise "Unsupported type #{spec.class} for #{spec}" raise "Unsupported type #{spec.class} for #{spec}"
end end
@ -78,13 +78,13 @@ class DependencyCollector
when :autoconf, :automake, :bsdmake, :libtool, :libltdl when :autoconf, :automake, :bsdmake, :libtool, :libltdl
# Xcode no longer provides autotools or some other build tools # Xcode no longer provides autotools or some other build tools
autotools_dep(spec, tag) autotools_dep(spec, tag)
when :x11 then X11Dependency.new(spec.to_s, tag)
when *X11Dependency::Proxy::PACKAGES when *X11Dependency::Proxy::PACKAGES
x11_dep(spec, tag) x11_dep(spec, tag)
when :cairo, :pixman when :cairo, :pixman
# We no longer use X11 psuedo-deps for cairo or pixman, # We no longer use X11 psuedo-deps for cairo or pixman,
# so just return a standard formula dependency. # so just return a standard formula dependency.
Dependency.new(spec.to_s, tag) Dependency.new(spec.to_s, tag)
when :x11 then X11Dependency.new(spec.to_s, tag)
when :xcode then XcodeDependency.new(tag) when :xcode then XcodeDependency.new(tag)
when :mysql then MysqlDependency.new(tag) when :mysql then MysqlDependency.new(tag)
when :postgresql then PostgresqlDependency.new(tag) when :postgresql then PostgresqlDependency.new(tag)