Update comment (and spacing) in download_strategy.

This commit is contained in:
Adam Vandenberg 2009-12-07 10:12:38 -08:00 committed by Max Howell
parent d0d0ca0572
commit 02208387c2

View File

@ -52,6 +52,7 @@ class CurlDownloadStrategy <AbstractDownloadStrategy
end end
return @dl # thus performs checksum verification return @dl # thus performs checksum verification
end end
def stage def stage
# magic numbers stolen from /usr/share/file/magic/ # magic numbers stolen from /usr/share/file/magic/
File.open(@dl) do |f| File.open(@dl) do |f|
@ -74,6 +75,7 @@ class CurlDownloadStrategy <AbstractDownloadStrategy
end end
end end
end end
private private
def chdir def chdir
entries=Dir['*'] entries=Dir['*']
@ -82,6 +84,7 @@ private
when 1 then Dir.chdir entries.first rescue nil when 1 then Dir.chdir entries.first rescue nil
end end
end end
def ext def ext
# GitHub uses odd URLs for zip files, so check for those # GitHub uses odd URLs for zip files, so check for those
rx=%r[http://(www\.)?github\.com/.*/(zip|tar)ball/] rx=%r[http://(www\.)?github\.com/.*/(zip|tar)ball/]
@ -118,6 +121,7 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
puts "Repository already checked out" puts "Repository already checked out"
end end
end end
def stage def stage
# Force the export, since the target directory will already exist # Force the export, since the target directory will already exist
args = [svn, 'export', '--force', @co, Dir.pwd] args = [svn, 'export', '--force', @co, Dir.pwd]
@ -126,7 +130,9 @@ class SubversionDownloadStrategy <AbstractDownloadStrategy
safe_system *args safe_system *args
end 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 def svn
'/usr/bin/svn' '/usr/bin/svn'
end end
@ -143,6 +149,7 @@ class GitDownloadStrategy <AbstractDownloadStrategy
puts "Repository already cloned to #{@clone}" puts "Repository already cloned to #{@clone}"
end end
end end
def stage def stage
dst = Dir.getwd dst = Dir.getwd
Dir.chdir @clone do Dir.chdir @clone do
@ -187,7 +194,6 @@ class CVSDownloadStrategy <AbstractDownloadStrategy
FileUtils.cp_r(Dir[HOMEBREW_CACHE+@unique_token+"*"], Dir.pwd) FileUtils.cp_r(Dir[HOMEBREW_CACHE+@unique_token+"*"], Dir.pwd)
require 'find' require 'find'
Find.find(Dir.pwd) do |path| Find.find(Dir.pwd) do |path|
if FileTest.directory?(path) && File.basename(path) == "CVS" if FileTest.directory?(path) && File.basename(path) == "CVS"
Find.prune Find.prune
@ -230,6 +236,7 @@ class MercurialDownloadStrategy <AbstractDownloadStrategy
puts "Repository already cloned" puts "Repository already cloned"
end end
end end
def stage def stage
dst=Dir.getwd dst=Dir.getwd
Dir.chdir @clone do Dir.chdir @clone do