Add cache location support to CVS.
This allows formulaes which use CVS to support: brew --cache [formula]
This commit is contained in:
		
							parent
							
								
									ff9c50151d
								
							
						
					
					
						commit
						eb30a8555b
					
				@ -204,9 +204,15 @@ class GitDownloadStrategy <AbstractDownloadStrategy
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
class CVSDownloadStrategy <AbstractDownloadStrategy
 | 
			
		||||
  def initialize url, name, version, specs
 | 
			
		||||
    super
 | 
			
		||||
    @co=HOMEBREW_CACHE+@unique_token
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def cached_location; @co; end
 | 
			
		||||
 | 
			
		||||
  def fetch
 | 
			
		||||
    ohai "Checking out #{@url}"
 | 
			
		||||
    @co=HOMEBREW_CACHE+@unique_token
 | 
			
		||||
 | 
			
		||||
    # URL of cvs cvs://:pserver:anoncvs@www.gccxml.org:/cvsroot/GCC_XML:gccxml
 | 
			
		||||
    # will become:
 | 
			
		||||
@ -220,14 +226,13 @@ class CVSDownloadStrategy <AbstractDownloadStrategy
 | 
			
		||||
        safe_system '/usr/bin/cvs', '-d', url, 'checkout', '-d', @unique_token, mod
 | 
			
		||||
      end
 | 
			
		||||
    else
 | 
			
		||||
      d = HOMEBREW_CACHE+@unique_token
 | 
			
		||||
      puts "Updating #{d}"
 | 
			
		||||
      Dir.chdir(d) { safe_system '/usr/bin/cvs', 'up' }
 | 
			
		||||
      puts "Updating #{@co}"
 | 
			
		||||
      Dir.chdir(@co) { safe_system '/usr/bin/cvs', 'up' }
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def stage
 | 
			
		||||
    FileUtils.cp_r(Dir[HOMEBREW_CACHE+@unique_token+"*"], Dir.pwd)
 | 
			
		||||
    FileUtils.cp_r Dir[@co+"*"], Dir.pwd
 | 
			
		||||
 | 
			
		||||
    require 'find'
 | 
			
		||||
    Find.find(Dir.pwd) do |path|
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user