Implement inferred CVS dependency

Fixes Homebrew/homebrew#24444.
Closes Homebrew/homebrew#24445.
Closes Homebrew/homebrew#24458.
This commit is contained in:
Jack Nagel 2013-11-18 15:58:41 -06:00
parent 4943a81373
commit 1f190890fd
2 changed files with 14 additions and 3 deletions

View File

@ -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

View File

@ -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