diff options
| author | Adam Vandenberg | 2009-12-07 10:12:38 -0800 |
|---|---|---|
| committer | Max Howell | 2009-12-12 16:24:15 +0000 |
| commit | 02208387c27cdfac5397948547e98eee4a5739d3 (patch) | |
| tree | fe5c9a6a4776da4e63a401ef2f4c178aae58f9fb /Library | |
| parent | d0d0ca05724bcd39173acb183fb36b34f005e165 (diff) | |
| download | brew-02208387c27cdfac5397948547e98eee4a5739d3.tar.bz2 | |
Update comment (and spacing) in download_strategy.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 32bee69cc..8cbb4cc5e 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -52,6 +52,7 @@ class CurlDownloadStrategy <AbstractDownloadStrategy end return @dl # thus performs checksum verification end + def stage # magic numbers stolen from /usr/share/file/magic/ File.open(@dl) do |f| @@ -74,6 +75,7 @@ class CurlDownloadStrategy <AbstractDownloadStrategy end end end + private def chdir entries=Dir['*'] @@ -82,6 +84,7 @@ private when 1 then Dir.chdir entries.first rescue nil end end + def ext # GitHub uses odd URLs for zip files, so check for those rx=%r[http://(www\.)?github\.com/.*/(zip|tar)ball/] @@ -118,6 +121,7 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy puts "Repository already checked out" end end + def stage # Force the export, since the target directory will already exist args = [svn, 'export', '--force', @co, Dir.pwd] @@ -126,7 +130,9 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy safe_system *args end - # currently only used by mplayer.rb + # Override this method in a DownloadStrategy to force the use of a non- + # sysetm svn binary. mplayer.rb uses this to require a svn that + # understands externals. def svn '/usr/bin/svn' end @@ -143,6 +149,7 @@ class GitDownloadStrategy <AbstractDownloadStrategy puts "Repository already cloned to #{@clone}" end end + def stage dst = Dir.getwd Dir.chdir @clone do @@ -187,7 +194,6 @@ class CVSDownloadStrategy <AbstractDownloadStrategy FileUtils.cp_r(Dir[HOMEBREW_CACHE+@unique_token+"*"], Dir.pwd) require 'find' - Find.find(Dir.pwd) do |path| if FileTest.directory?(path) && File.basename(path) == "CVS" Find.prune @@ -230,6 +236,7 @@ class MercurialDownloadStrategy <AbstractDownloadStrategy puts "Repository already cloned" end end + def stage dst=Dir.getwd Dir.chdir @clone do |
