diff options
| author | Jack Nagel | 2013-11-18 15:58:41 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-11-18 19:56:15 -0600 |
| commit | 1f190890fd60f9e66aeaf71c4c42473334cc514a (patch) | |
| tree | b4999a7e2a157ff5a38d2b14a897ac697f7325e8 /Library | |
| parent | 4943a813738f41955a2012a397ade053cbff5679 (diff) | |
| download | brew-1f190890fd60f9e66aeaf71c4c42473334cc514a.tar.bz2 | |
Implement inferred CVS dependency
Fixes Homebrew/homebrew#24444.
Closes Homebrew/homebrew#24445.
Closes Homebrew/homebrew#24458.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/dependency_collector.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 8ede0c144..2c141f011 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 c3b76fbbf..f6a3c9129 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 |
