Add fast path for CVS dep

The search mechanism in MacOS::Xcode is very slow. It requires shelling
out at least twice, and possibly a third time (in the CLT-only case).

Calling provides_cvs? activates this in order to determine the Xcode
version. But if we know that there isn't an Xcode available for the
current OS that meets the criteria, we can avoid this check entirely.
This commit is contained in:
Jack Nagel 2014-04-02 19:58:15 -05:00
parent 55b0ee787a
commit bb5e0812fb

View File

@ -170,7 +170,7 @@ class DependencyCollector
when strategy <= BazaarDownloadStrategy when strategy <= BazaarDownloadStrategy
Dependency.new("bazaar", tags) Dependency.new("bazaar", tags)
when strategy <= CVSDownloadStrategy when strategy <= CVSDownloadStrategy
Dependency.new("cvs", tags) unless MacOS::Xcode.provides_cvs? Dependency.new("cvs", tags) if MacOS.version >= :mavericks || !MacOS::Xcode.provides_cvs?
when strategy < AbstractDownloadStrategy when strategy < AbstractDownloadStrategy
# allow unknown strategies to pass through # allow unknown strategies to pass through
else else