diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 8ede0c1448..2c141f0117 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -165,6 +165,8 @@ class DependencyCollector Dependency.new("fossil", tags) when strategy <= BazaarDownloadStrategy Dependency.new("bazaar", tags) + when strategy <= CVSDownloadStrategy + Dependency.new("cvs", tags) if MacOS.version >= :mavericks when strategy < AbstractDownloadStrategy # allow unknown strategies to pass through else diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index c3b76fbbff..f6a3c91296 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -591,6 +591,15 @@ class GitDownloadStrategy < VCSDownloadStrategy end class CVSDownloadStrategy < VCSDownloadStrategy + def cvspath + @path ||= %W[ + /usr/bin/cvs + #{HOMEBREW_PREFIX}/bin/cvs + #{HOMEBREW_PREFIX}/opt/cvs/bin/cvs + #{which("cvs")} + ].find { |p| File.executable? p } + end + def cache_tag; "cvs" end def fetch @@ -604,12 +613,12 @@ class CVSDownloadStrategy < VCSDownloadStrategy unless @clone.exist? HOMEBREW_CACHE.cd do - safe_system '/usr/bin/cvs', '-d', url, 'login' - safe_system '/usr/bin/cvs', '-d', url, 'checkout', '-d', cache_filename("cvs"), mod + safe_system cvspath, '-d', url, 'login' + safe_system cvspath, '-d', url, 'checkout', '-d', cache_filename("cvs"), mod end else puts "Updating #{@clone}" - @clone.cd { safe_system '/usr/bin/cvs', 'up' } + @clone.cd { safe_system cvspath, 'up' } end end